13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 40: Working with local SQL<br />

databases in AIR<br />

Adobe AIR 1.0 and later<br />

Adobe® AIR® includes the capability of creating and working with local SQL databases. The runtime includes a SQL<br />

database <strong>en</strong>gine with support for many standard SQL features, using the op<strong>en</strong> source SQLite database system. A local<br />

SQL database can be used for storing local, persist<strong>en</strong>t data. For example, it can be used for application data, application<br />

user settings, docum<strong>en</strong>ts, or any other type of data that you want your application to save locally.<br />

About local SQL databases<br />

Adobe AIR 1.0 and later<br />

For a quick explanation and code examples of using SQL databases, see the following quick start articles on the Adobe<br />

Developer Connection:<br />

Working asynchronously with a local SQL database (Flex)<br />

Working synchronously with a local SQL database (Flex)<br />

Using an <strong>en</strong>crypted database (Flex)<br />

Working asynchronously with a local SQL database (Flash)<br />

Working synchronously with a local SQL database (Flash)<br />

Using an <strong>en</strong>crypted database (Flash)<br />

Adobe AIR includes a SQL-based relational database <strong>en</strong>gine that runs within the runtime, with data stored locally in<br />

database files on the computer on which the AIR application runs (for example, on the computer’s hard drive). Because<br />

the database runs and data files are stored locally, a database can be used by an AIR application regardless of whether<br />

a network connection is available. Thus, the runtime’s local SQL database <strong>en</strong>gine provides a conv<strong>en</strong>i<strong>en</strong>t mechanism<br />

for storing persist<strong>en</strong>t, local application data, particularly if you have experi<strong>en</strong>ce with SQL and relational databases.<br />

Uses for local SQL databases<br />

Adobe AIR 1.0 and later<br />

The AIR local SQL database functionality can be used for any purpose for which you might want to store application<br />

data on a user’s local computer. Adobe AIR includes several mechanisms for storing data locally, each of which has<br />

differ<strong>en</strong>t advantages. The following are some possible uses for a local SQL database in your AIR application:<br />

For a data-ori<strong>en</strong>ted application (for example an address book), a database can be used to store the main application data.<br />

For a docum<strong>en</strong>t-ori<strong>en</strong>ted application, where users create docum<strong>en</strong>ts to save and possibly share, each docum<strong>en</strong>t<br />

could be saved as a database file, in a user-designated location. (Note, however, that unless the database is <strong>en</strong>crypted<br />

any AIR application would be able to op<strong>en</strong> the database file. Encryption is recomm<strong>en</strong>ded for pot<strong>en</strong>tially s<strong>en</strong>sitive<br />

docum<strong>en</strong>ts.)<br />

Last updated 6/6/2012<br />

713

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!