public abstract class DBContextBase extends Object implements DBContext
| Constructor and Description |
|---|
DBContextBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
appendRollbackHandler(DBRollbackHandler handler) |
protected void |
closeConnection()
helper to close a connection on discard
|
void |
commit() |
DBCommand |
createCommand()
Creates a new Command object for the given database
|
protected DBUtils |
createUtils()
Factory function for Utils creation
|
void |
discard()
Discard connection releated ressources
WARING: No gurarantee it will be called
|
int |
executeDelete(DBTable from,
DBCommand cmd)
Executes a Delete statement from a command object
|
int |
executeInsert(DBCommand cmd)
Executes an Insert statement from a command object
|
int |
executeInsertInto(DBTable table,
DBCommand cmd)
Executes an InsertInfo statement from a command object
|
int |
executeSQL(String sqlCmd,
Object[] sqlParams)
Executes an SQLStatment
|
int |
executeUpdate(DBCommand cmd)
Executes an Update statement from a command object
|
Connection |
getConnection() |
protected abstract Connection |
getConnection(boolean required) |
protected abstract DBRollbackManager |
getRollbackManager(boolean required) |
DBUtils |
getUtils() |
abstract boolean |
isPreparedStatementsEnabled()
returns whether DBCommmand should automatically create a prepared statement with command params (?)
|
void |
removeRollbackHandler(DBObject object) |
void |
rollback()
Discards all changes made since the previous commit/rollback
and releases any database locks currently held by this
Connection.
|
protected void |
setUtils(DBUtils utils) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDbms, isRollbackHandlingEnabledprotected DBUtils createUtils()
protected void setUtils(DBUtils utils)
protected abstract Connection getConnection(boolean required)
protected abstract DBRollbackManager getRollbackManager(boolean required)
public Connection getConnection()
getConnection in interface DBContextpublic abstract boolean isPreparedStatementsEnabled()
public final DBCommand createCommand()
createCommand in interface DBContextpublic final int executeSQL(String sqlCmd, Object[] sqlParams)
executeSQL in interface DBContextsqlCmd - the SQL-CommandsqlParams - a list of objects to replace sql parameterspublic final int executeInsert(DBCommand cmd)
executeInsert in interface DBContextcmd - the command object containing the insert commandpublic final int executeInsertInto(DBTable table, DBCommand cmd)
executeInsertInto in interface DBContexttable - the table into which to insert the selected datacmd - the command object containing the selection commandpublic final int executeUpdate(DBCommand cmd)
executeUpdate in interface DBContextcmd - the command object containing the update commandpublic final int executeDelete(DBTable from, DBCommand cmd)
executeDelete in interface DBContextfrom - the database table from which to delete recordscmd - the command object containing the delete constraintspublic void rollback()
public void appendRollbackHandler(DBRollbackHandler handler)
appendRollbackHandler in interface DBContextpublic void removeRollbackHandler(DBObject object)
removeRollbackHandler in interface DBContextpublic void discard()
protected void closeConnection()
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.