public class DBContextStatic extends DBContextBase
Constructor and Description |
---|
DBContextStatic(DBMSHandler dbmsHandler,
Connection conn)
Creates a static DBContext with default options
|
DBContextStatic(DBMSHandler dbmsHandler,
Connection conn,
boolean closeOnDiscard)
Creates a static DBContext with custom options
|
Modifier and Type | Method and Description |
---|---|
void |
discard()
Discard connection releated ressources
WARING: No gurarantee it will be called
|
protected Connection |
getConnection(boolean create) |
DBMSHandler |
getDbms() |
protected DBRollbackManager |
getRollbackManager(boolean create) |
boolean |
isPreparedStatementsEnabled()
returns whether DBCommmand should automatically create a prepared statement with command params (?)
|
boolean |
isRollbackHandlingEnabled() |
DBContextStatic |
setPreparedStatementsEnabled(boolean enabled)
Enables or disables the use of prepared statements for update and insert commands as well as for read operations on a DBRecord.
|
DBContextStatic |
setRollbackHandlingEnabled(boolean enabled)
Enables or disables rollback handling
|
appendRollbackHandler, closeConnection, commit, createCommand, createUtils, executeDelete, executeInsert, executeInsertInto, executeSQL, executeUpdate, getConnection, getUtils, removeRollbackHandler, rollback
public DBContextStatic(DBMSHandler dbmsHandler, Connection conn)
dbmsHandler
- the database handlerconn
- a database connectionpublic DBContextStatic(DBMSHandler dbmsHandler, Connection conn, boolean closeOnDiscard)
dbmsHandler
- the database handlerconn
- a database connectioncloseOnDiscard
- flag whether to close the connection when calling discard()public DBMSHandler getDbms()
public boolean isPreparedStatementsEnabled()
DBContextBase
isPreparedStatementsEnabled
in class DBContextBase
public DBContextStatic setPreparedStatementsEnabled(boolean enabled)
enabled
- flag whether to enable prepared statementspublic boolean isRollbackHandlingEnabled()
public DBContextStatic setRollbackHandlingEnabled(boolean enabled)
enabled
- flag whether to enable rollback handlingpublic void discard()
DBContextBase
discard
in interface DBContext
discard
in class DBContextBase
protected Connection getConnection(boolean create)
getConnection
in class DBContextBase
protected DBRollbackManager getRollbackManager(boolean create)
getRollbackManager
in class DBContextBase
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.