Академический Документы
Профессиональный Документы
Культура Документы
**********
Uses for local SQL DB
**********************
* For a data-oriented application (address book i,e.)
* Fora document-oriented application,
* For a network-asware application (to store local data when there's no internet
to the synchronizer the app)
* To store local users' application settings (windows size, positions, etc.)
* Take into account
*****************
* Any AIR app would be able to open any DB file. (use encryption mechanism to
secure the DB)
About AIR DB and DB files
*************************
* An individual AIR local SQL DB is store as a single file on the computer's fil
e system
* The runtime includes all mechanism to manipulate data from the DBF (data base
file)
* The runtime does not specify how or where DB DATA is stored on the FS (file sy
stem). The DB is a single FS file.
* You CAN specify the location in the file system where the DBF is stored
* A single AIR app can access one or many separate DB (ie. separate DBF)
* You can locate your DB as needed by the design of your app on the FS, and file
access constraints of the OS
* Each user can have a separate DBF for their specific data, or a DBF can be acc
essed by all application users on a single computer for shared data
* Because the data is local to a single computer, data is not automatically shar
ed among users on different computers.
* The local QDL DBE (data base engine) doen't provide any capability to execute
SQL statements agains a remote or server-based DB
SQL in Actionscript
*******************
* To work with SQL DB in AS3, you use instances of these classes in the flash.da
ta package
*flash.data.SQLConnection* Provides the means to create and open databases (DBF)
, as well as methods for performing database-level operations and for controllin
g DB transactions
*flash.data.SQLStatement* Represents a single SQL statement (a single query com
mand) that is executed on a DB, including defining the statement text and settin
g paramenters values
*flash.data.SQLResult* Provides a way to get information about or results from e
xecuting statements, such as the result rows from a SELECT statement, the number
of rows affected by and UPDATE or DELETE statement, and so forth
* To obtain schema information describing the structure of the DB, you can use t
heese clases in the flash.data package.
* The following classes in the flash.events package represents the events (and s
upporting constants) to use.
*flash.data.SQLEvent*. Defines the events that a SQLConnection or SQLSt
atement instance dispatches when any of its operations execute successfully. Eac
h operation has an associated event type constant defined in the SQLEvent class
*flash.data.SQLErrorEvent*. Defines the event that a SQLConnection or SQLSta
tement instance dispatches when any of its operations results in an error
*flash.data.SQLUpdateEvent*. Defines the event that a SQLConnection instances
dispatches when table and data in one of its connected databases changes as a r
esult of an INSERT, UPDATE, or DELETE SQL statement being executed.
* Finally, the following classes in the flash.errors package provide information
about database operation errors:
*flash.data.SQLError*. Provides information about a DB operation error,
including: the operation that was being attempted and the cause of the failure.
*flash.data.SQLErrorEvent*. Defines a set of constants representing the pssi
ble values for the sQLError class's operation property, which indicates the data
base operation that resulted in an error.
*General aspects*
* Whether operations execute asynchronously or synchronously is set at the SQLCo
nnection level.
* Using a single DBC (data base connection) you can't execute some operations or
statements asynchronously and other synchronously
* You specify whether a SQLConnection operates in Synch or Asynch execution mode
by calling a SQLConnection method to open a DB
* Calling SQLConnection.open() the connection operates in sync execution mode.
* Calling SQLConnection.openAsync() the connection operates in async execution m
ode.
* Once a SQLConnection instance is connected to a DB using open() or openAsync()
, it is fixed to sync or async execution mode unless you close a reopen the conn
ection to the DB