NKSQLite

Description

This class is used to access sqlite databases (initial database must be provided by developer and included into project).

Usage

Example

var database = new NKSQLite();
database.openDatabase("nk.sqlite", "no");
database.executeSQL("CREATE TABLE todo(pk INTEGER PRIMARY KEY, text VARCHAR(25), priority INTEGER, complete BOOLEAN)");
database.executeSQL("INSERT INTO todo(text,priority,complete) VALUES('Take out the trash',3,0)");
database.executeSQL("INSERT INTO todo(text,priority,complete) VALUES('Do Computer Science homework',1,0)");
database.executeSQL("INSERT INTO todo(text,priority,complete) VALUES('Learn Objective C',1,0)");
database.executeSQL("INSERT INTO todo(text,priority,complete) VALUES('DIGG this tutorial',2,0)");
database.executeSQL("SELECT * FROM todo");
results = database.getResults();
for (i=0; i<results.length; i++)
{
document.body.innerHTML+="<p>"+results[i].priority+" | "+results[i].complete+" | "+results[i].text+"</p>";
}
database.closeDatabase();

Test database using this functions:

Open Database
Create Table
Insert values
Retrieve Results
Reset Database