public class AndroidConnectionSource
extends com.j256.ormlite.support.BaseConnectionSource
implements com.j256.ormlite.support.ConnectionSource
SQLiteOpenHelper
. For best results, use
OrmLiteSqliteOpenHelper
. You can also construct with a SQLiteDatabase
.Constructor and Description |
---|
AndroidConnectionSource(android.database.sqlite.SQLiteDatabase sqliteDatabase) |
AndroidConnectionSource(android.database.sqlite.SQLiteOpenHelper helper) |
Modifier and Type | Method and Description |
---|---|
void |
clearSpecialConnection(com.j256.ormlite.support.DatabaseConnection connection) |
void |
close() |
void |
closeQuietly() |
com.j256.ormlite.db.DatabaseType |
getDatabaseType() |
com.j256.ormlite.support.DatabaseConnection |
getReadOnlyConnection(String tableName) |
com.j256.ormlite.support.DatabaseConnection |
getReadWriteConnection(String tableName) |
boolean |
isCancelQueriesEnabled() |
boolean |
isOpen(String tableName) |
boolean |
isSingleConnection(String tableName) |
void |
releaseConnection(com.j256.ormlite.support.DatabaseConnection connection) |
boolean |
saveSpecialConnection(com.j256.ormlite.support.DatabaseConnection connection) |
void |
setCancelQueriesEnabled(boolean cancelQueriesEnabled)
Set to true to enable the canceling of queries.
|
static void |
setDatabaseConnectionProxyFactory(com.j256.ormlite.support.DatabaseConnectionProxyFactory connectionProxyFactory)
Set to enable connection proxying.
|
String |
toString() |
clearSpecial, getSavedConnection, getSpecialConnection, isSavedConnection, isSingleConnection, saveSpecial
public AndroidConnectionSource(android.database.sqlite.SQLiteOpenHelper helper)
public AndroidConnectionSource(android.database.sqlite.SQLiteDatabase sqliteDatabase)
public com.j256.ormlite.support.DatabaseConnection getReadOnlyConnection(String tableName) throws SQLException
getReadOnlyConnection
in interface com.j256.ormlite.support.ConnectionSource
SQLException
public com.j256.ormlite.support.DatabaseConnection getReadWriteConnection(String tableName) throws SQLException
getReadWriteConnection
in interface com.j256.ormlite.support.ConnectionSource
SQLException
public void releaseConnection(com.j256.ormlite.support.DatabaseConnection connection)
releaseConnection
in interface com.j256.ormlite.support.ConnectionSource
public boolean saveSpecialConnection(com.j256.ormlite.support.DatabaseConnection connection) throws SQLException
saveSpecialConnection
in interface com.j256.ormlite.support.ConnectionSource
SQLException
public void clearSpecialConnection(com.j256.ormlite.support.DatabaseConnection connection)
clearSpecialConnection
in interface com.j256.ormlite.support.ConnectionSource
public void close()
close
in interface AutoCloseable
public void closeQuietly()
closeQuietly
in interface com.j256.ormlite.support.ConnectionSource
public com.j256.ormlite.db.DatabaseType getDatabaseType()
getDatabaseType
in interface com.j256.ormlite.support.ConnectionSource
public boolean isOpen(String tableName)
isOpen
in interface com.j256.ormlite.support.ConnectionSource
public boolean isSingleConnection(String tableName)
isSingleConnection
in interface com.j256.ormlite.support.ConnectionSource
public static void setDatabaseConnectionProxyFactory(com.j256.ormlite.support.DatabaseConnectionProxyFactory connectionProxyFactory)
public boolean isCancelQueriesEnabled()
public void setCancelQueriesEnabled(boolean cancelQueriesEnabled)
NOTE: This will incur a slight memory increase for all Cursor based queries -- even if cancel is not called for them.
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.