| java.lang.Object com.mckoi.database.jdbcserver.AbstractJDBCDatabaseInterface
All known Subclasses: com.mckoi.database.jdbcserver.JDBCDatabaseInterface,
AbstractJDBCDatabaseInterface | abstract public class AbstractJDBCDatabaseInterface implements DatabaseInterface(Code) | | An abstract implementation of JDBCDatabaseInterface that provides a
connection between a single DatabaseConnection and a DatabaseInterface
implementation.
This receives database commands from the JDBC layer and dispatches the
queries to the database system. It also manages ResultSet maps for query
results.
This implementation does not handle authentication (login) / construction
of the DatabaseConnection object, or disposing of the connection.
This implementation ignores the AUTO-COMMIT flag when a query is executed.
To implement AUTO-COMMIT, you should 'commit' after a command is executed.
SYNCHRONIZATION: This interface is NOT thread-safe. To make a thread-safe
implementation use the LockingMechanism.
See JDBCDatabaseInterface for a standard server-side implementation of this
class.
author: Tobias Downer |
Method Summary | |
final public DebugLogger | Debug() Returns a DebugLogger object that can be used to log debug messages
against. | final protected void | checkNotDisposed() Checks if the interface is disposed, and if it is generates a friendly
SQLException informing the user of this. | final protected void | clearResultSetMap() Clears the contents of the result set map. | public void | disposeResult(int result_id) | public void | disposeStreamableObject(int result_id, long streamable_object_id) | public QueryResponse | execQuery(SQLQuery query) | public void | finalize() Clean up if this object is GC'd. | final protected Database | getDatabase() Returns the Database that is the context of this interface. | final protected DatabaseConnection | getDatabaseConnection() Returns the DatabaseConnection objcet for this connection. | public ResultPart | getResultPart(int result_id, int row_number, int row_count) | public StreamableObjectPart | getStreamableObjectPart(int result_id, long streamable_object_id, long offset, int len) | final protected User | getUser() Returns the User object for this connection. | final protected SQLException | handleExecuteThrowable(Throwable e, SQLQuery query) Wraps a Throwable thrown by the execution of a query in DatabaseConnection
with an SQLException and puts the appropriate error messages to the debug
log. | final protected void | init(User user, DatabaseConnection connection) Initializes this database interface with a User and DatabaseConnection
object. | final protected void | internalDispose() Disposes all resources associated with this object. | public void | pushStreamableObjectPart(byte type, long object_id, long object_length, byte[] buf, long offset, int length) |
AbstractJDBCDatabaseInterface | public AbstractJDBCDatabaseInterface(Database database)(Code) | | Sets up the database interface.
|
Debug | final public DebugLogger Debug()(Code) | | Returns a DebugLogger object that can be used to log debug messages
against.
|
checkNotDisposed | final protected void checkNotDisposed() throws SQLException(Code) | | Checks if the interface is disposed, and if it is generates a friendly
SQLException informing the user of this.
|
clearResultSetMap | final protected void clearResultSetMap()(Code) | | Clears the contents of the result set map. This removes all result_id
ResultSetInfo maps.
|
disposeStreamableObject | public void disposeStreamableObject(int result_id, long streamable_object_id) throws SQLException(Code) | | |
finalize | public void finalize() throws Throwable(Code) | | Clean up if this object is GC'd.
|
getDatabase | final protected Database getDatabase()(Code) | | Returns the Database that is the context of this interface.
|
getDatabaseConnection | final protected DatabaseConnection getDatabaseConnection()(Code) | | Returns the DatabaseConnection objcet for this connection.
|
getUser | final protected User getUser()(Code) | | Returns the User object for this connection.
|
handleExecuteThrowable | final protected SQLException handleExecuteThrowable(Throwable e, SQLQuery query)(Code) | | Wraps a Throwable thrown by the execution of a query in DatabaseConnection
with an SQLException and puts the appropriate error messages to the debug
log.
|
init | final protected void init(User user, DatabaseConnection connection)(Code) | | Initializes this database interface with a User and DatabaseConnection
object. This would typically be called from inside an authentication
method, or from 'login'. This must be set before the object can be
used.
|
internalDispose | final protected void internalDispose()(Code) | | Disposes all resources associated with this object. This clears the
ResultSet map, and NULLs all references to help the garbage collector.
This method would normally be called from implementations of the
'dispose' method.
|
pushStreamableObjectPart | public void pushStreamableObjectPart(byte type, long object_id, long object_length, byte[] buf, long offset, int length) throws SQLException(Code) | | |
|
|