public class AndroidDatabaseConnection extends Object implements com.j256.ormlite.support.DatabaseConnection
Constructor and Description |
---|
AndroidDatabaseConnection(android.database.sqlite.SQLiteDatabase db,
boolean readWrite) |
AndroidDatabaseConnection(android.database.sqlite.SQLiteDatabase db,
boolean readWrite,
boolean cancelQueriesEnabled) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
closeQuietly() |
void |
commit(Savepoint savepoint) |
com.j256.ormlite.support.CompiledStatement |
compileStatement(String statement,
com.j256.ormlite.stmt.StatementBuilder.StatementType type,
com.j256.ormlite.field.FieldType[] argFieldTypes,
int resultFlags,
boolean cacheStore) |
int |
delete(String statement,
Object[] args,
com.j256.ormlite.field.FieldType[] argFieldTypes) |
int |
executeStatement(String statementStr,
int resultFlags) |
Connection |
getUnderlyingConnection() |
int |
insert(String statement,
Object[] args,
com.j256.ormlite.field.FieldType[] argFieldTypes,
com.j256.ormlite.support.GeneratedKeyHolder keyHolder) |
boolean |
isAutoCommit() |
boolean |
isAutoCommitSupported() |
boolean |
isClosed() |
boolean |
isReadWrite()
Return whether this connection is read-write or not (real-only).
|
boolean |
isTableExists(String tableName) |
long |
queryForLong(String statement) |
long |
queryForLong(String statement,
Object[] args,
com.j256.ormlite.field.FieldType[] argFieldTypes) |
<T> Object |
queryForOne(String statement,
Object[] args,
com.j256.ormlite.field.FieldType[] argFieldTypes,
com.j256.ormlite.stmt.GenericRowMapper<T> rowMapper,
com.j256.ormlite.dao.ObjectCache objectCache) |
void |
releaseSavePoint(Savepoint savePoint) |
void |
rollback(Savepoint savepoint) |
void |
setAutoCommit(boolean autoCommit) |
Savepoint |
setSavePoint(String name) |
String |
toString() |
int |
update(String statement,
Object[] args,
com.j256.ormlite.field.FieldType[] argFieldTypes) |
public AndroidDatabaseConnection(android.database.sqlite.SQLiteDatabase db, boolean readWrite)
public AndroidDatabaseConnection(android.database.sqlite.SQLiteDatabase db, boolean readWrite, boolean cancelQueriesEnabled)
public boolean isAutoCommitSupported()
isAutoCommitSupported
in interface com.j256.ormlite.support.DatabaseConnection
public boolean isAutoCommit() throws SQLException
isAutoCommit
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public void setAutoCommit(boolean autoCommit)
setAutoCommit
in interface com.j256.ormlite.support.DatabaseConnection
public Savepoint setSavePoint(String name) throws SQLException
setSavePoint
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public boolean isReadWrite()
public void commit(Savepoint savepoint) throws SQLException
commit
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public void rollback(Savepoint savepoint) throws SQLException
rollback
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public void releaseSavePoint(Savepoint savePoint)
releaseSavePoint
in interface com.j256.ormlite.support.DatabaseConnection
public int executeStatement(String statementStr, int resultFlags) throws SQLException
executeStatement
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public com.j256.ormlite.support.CompiledStatement compileStatement(String statement, com.j256.ormlite.stmt.StatementBuilder.StatementType type, com.j256.ormlite.field.FieldType[] argFieldTypes, int resultFlags, boolean cacheStore)
compileStatement
in interface com.j256.ormlite.support.DatabaseConnection
public int insert(String statement, Object[] args, com.j256.ormlite.field.FieldType[] argFieldTypes, com.j256.ormlite.support.GeneratedKeyHolder keyHolder) throws SQLException
insert
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public int update(String statement, Object[] args, com.j256.ormlite.field.FieldType[] argFieldTypes) throws SQLException
update
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public int delete(String statement, Object[] args, com.j256.ormlite.field.FieldType[] argFieldTypes) throws SQLException
delete
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public <T> Object queryForOne(String statement, Object[] args, com.j256.ormlite.field.FieldType[] argFieldTypes, com.j256.ormlite.stmt.GenericRowMapper<T> rowMapper, com.j256.ormlite.dao.ObjectCache objectCache) throws SQLException
queryForOne
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public long queryForLong(String statement) throws SQLException
queryForLong
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public long queryForLong(String statement, Object[] args, com.j256.ormlite.field.FieldType[] argFieldTypes) throws SQLException
queryForLong
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public void close() throws Exception
close
in interface AutoCloseable
Exception
public void closeQuietly()
closeQuietly
in interface com.j256.ormlite.support.DatabaseConnection
public boolean isClosed() throws SQLException
isClosed
in interface com.j256.ormlite.support.DatabaseConnection
SQLException
public boolean isTableExists(String tableName)
isTableExists
in interface com.j256.ormlite.support.DatabaseConnection
public Connection getUnderlyingConnection()
getUnderlyingConnection
in interface com.j256.ormlite.support.DatabaseConnection
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.