|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConnectionSource
A reduction of the SQL DataSource so we can implement its functionality outside of JDBC.
Method Summary | |
---|---|
void |
clearSpecialConnection(DatabaseConnection connection)
Clear the saved connection. |
void |
close()
Close any outstanding database connections. |
DatabaseType |
getDatabaseType()
Return the DatabaseTypre associated with this connection. |
DatabaseConnection |
getReadOnlyConnection()
Return a database connection suitable for read-only operations. |
DatabaseConnection |
getReadWriteConnection()
Return a database connection suitable for read or write operations. |
DatabaseConnection |
getSpecialConnection()
Return the currently saved connection or null if none. |
void |
releaseConnection(DatabaseConnection connection)
Release a database connection previously returned by getReadOnlyConnection() or
getReadWriteConnection() . |
boolean |
saveSpecialConnection(DatabaseConnection connection)
Save this connection and return it for all calls to getReadOnlyConnection() and
getReadWriteConnection() unless the clearSpecialConnection(DatabaseConnection) method is
called, all This is used by the transaction mechanism since since all operations within a transaction must
operate on the same connection. |
Method Detail |
---|
DatabaseConnection getReadOnlyConnection() throws SQLException
releaseConnection(DatabaseConnection)
.
SQLException
DatabaseConnection getReadWriteConnection() throws SQLException
releaseConnection(DatabaseConnection)
.
SQLException
void releaseConnection(DatabaseConnection connection) throws SQLException
getReadOnlyConnection()
or
getReadWriteConnection()
.
SQLException
boolean saveSpecialConnection(DatabaseConnection connection) throws SQLException
getReadOnlyConnection()
and
getReadWriteConnection()
unless the clearSpecialConnection(DatabaseConnection)
method is
called, all This is used by the transaction mechanism since since all operations within a transaction must
operate on the same connection. It is also used by the Android code during initialization.
NOTE: This should be a read-write connection since transactions and Android need it to be so.
NOTE: Saving a connection is usually accomplished using ThreadLocals so multiple threads should not be using connections in this scenario.
SQLException
void clearSpecialConnection(DatabaseConnection connection)
DatabaseConnection getSpecialConnection()
void close() throws SQLException
SQLException
DatabaseType getDatabaseType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |