Class Index | File Index

Classes


Namespace LocalDB


Defined in: db.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
contains reference to local database and handle its functionalities
Field Summary
Field Attributes Field Name and Description
<static>  
LocalDB.connection
<static>  
LocalDB.max_db_size
max database size
Method Summary
Method Attributes Method Name and Description
<static>  
LocalDB.connect()
connect to local database named main with max size = 100 GB.
<static>  
LocalDB.init(tx)
initiate the tables of the database.
<static>  
LocalDB.onError(e)
called in case of error in connecting with local database.
<static>  
LocalDB.onReady()
if database is ready to connect to server begin synchronization using RemoteDB.sync.
Namespace Detail
LocalDB
contains reference to local database and handle its functionalities
Field Detail
<static> LocalDB.connection

<static> LocalDB.max_db_size
max database size
Method Detail
<static> LocalDB.connect()
connect to local database named main with max size = 100 GB.
Description
if it is found just open it, else create it.
then begin initiation of database by calling LocalDB.init. if the initiation has been done successfuly call LocalDB.onReady, else call LocalDB.onError

<static> LocalDB.init(tx)
initiate the tables of the database.
Description
create table myProducts if not exits using the following query
create table if not exists myProduct(id INTEGER PRIMARY KEY,name,price)
Parameters:
{Object} tx
transaction manager that used to execute the SQL statement

<static> LocalDB.onError(e)
called in case of error in connecting with local database.
Description
printing the error code and the type of it
Parameters:
{Object} e
error code and type

<static> LocalDB.onReady()
if database is ready to connect to server begin synchronization using RemoteDB.sync.
Description
make many checks to begin synchronization such as:
1. checking network state
2. checking connection state
if the connection failed only display the offers calling Device.display

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Jul 24 2012 13:57:51 GMT+0200 (GMT+02:00)