|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cyberlab.db.local.AbstractSQLiteDBAdapter<T>
T
- The class type of the new SQliteDBAdapter.public abstract class AbstractSQLiteDBAdapter<T>
Applications using SQLite databases extend this class. This helps create the application SQLite database from files containing legal SQLite statements
or by copying an existing database into the application. This class uses the DatabaseHelper
.
Field Summary | |
---|---|
protected java.lang.String |
DATABASE_NAME
|
protected Context |
mCtx
|
protected SQLiteDatabase |
mDb
|
protected DatabaseHelper |
mDbHelper
|
Constructor Summary | |
---|---|
AbstractSQLiteDBAdapter(Context ctx,
java.lang.String dbFile)
|
|
AbstractSQLiteDBAdapter(Context ctx,
java.lang.String dbFile,
java.io.InputStream inputstream)
Installs a pre-existing SQLite database into application. |
|
AbstractSQLiteDBAdapter(Context ctx,
java.lang.String dbFile,
java.net.URL dbLocation)
Installs a pre-existing SQLite database into application. |
Method Summary | |
---|---|
void |
close()
Closes the database |
void |
exportDatabase(java.io.File out)
Export database to external file |
boolean |
isOpen()
Checks if database is opened |
T |
open()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.String DATABASE_NAME
protected Context mCtx
protected DatabaseHelper mDbHelper
protected SQLiteDatabase mDb
Constructor Detail |
---|
public AbstractSQLiteDBAdapter(Context ctx, java.lang.String dbFile)
ctx
- Application contextdbFile
- A file with this name must exist in the assets folder. This file contains legal SQLite syntax for
creating a databasepublic AbstractSQLiteDBAdapter(Context ctx, java.lang.String dbFile, java.net.URL dbLocation) throws java.lang.Exception
ctx
- Application contextdbFile
- Name of database (name of SQLite database file located in applications data directory)dbLocation
- URL location of pre-existing database
java.io.IOException
java.lang.Exception
public AbstractSQLiteDBAdapter(Context ctx, java.lang.String dbFile, java.io.InputStream inputstream) throws java.lang.Exception
ctx
- Application ContextdbFile
- Name of database (name of SQLite database file located in applications data directory)dbLocation
- InputStream of pre-existing database
java.io.IOException
java.lang.Exception
Method Detail |
---|
public T open() throws SQLException
SQLException
public void close()
public boolean isOpen()
public void exportDatabase(java.io.File out) throws java.lang.Exception
out
-
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |