abortBatch
public void abortBatch(SQLException sqle)
Must be called when an exception occurs
sqle
- the (not null) exception that is the reason for aborting
addToBatch
public void addToBatch(Expectation expectation)
throws SQLException,
HibernateException
Add an insert / delete / update to the current batch (might be called multiple times
for single prepareBatchStatement())
cancelLastQuery
public void cancelLastQuery()
throws HibernateException
Cancel the current query statement
closeConnection
public void closeConnection(Connection conn)
throws HibernateException
Dispose of the JDBC connection
closeQueryStatement
public void closeQueryStatement(PreparedStatement ps,
ResultSet rs)
throws SQLException
Close a prepared statement opened with prepareQueryStatement()
closeStatement
public void closeStatement(PreparedStatement ps)
throws SQLException
Close a prepared or callable statement opened using prepareStatement() or prepareCallableStatement()
closeStatements
public void closeStatements()
Close any query statements that were left lying around
getResultSet
public ResultSet getResultSet(CallableStatement ps,
Dialect dialect)
throws SQLException
Execute the statement and return the result set from a callable statement
getResultSet
public ResultSet getResultSet(PreparedStatement ps)
throws SQLException
Execute the statement and return the result set
hasOpenResources
public boolean hasOpenResources()
openConnection
public Connection openConnection()
throws HibernateException
Obtain a JDBC connection
openResourceStatsAsString
public String openResourceStatsAsString()
prepareBatchCallableStatement
public CallableStatement prepareBatchCallableStatement(String sql)
throws SQLException,
HibernateException
Get a batchable callable statement to use for inserting / deleting / updating
(might be called many times before a single call to executeBatch()).
After setting parameters, call addToBatch - do not execute the
statement explicitly.
prepareBatchStatement
public PreparedStatement prepareBatchStatement(String sql)
throws SQLException,
HibernateException
Get a batchable prepared statement to use for inserting / deleting / updating
(might be called many times before a single call to executeBatch()).
After setting parameters, call addToBatch - do not execute the
statement explicitly.
prepareCallableQueryStatement
public CallableStatement prepareCallableQueryStatement(String sql,
boolean scrollable,
ScrollMode scrollMode)
throws SQLException,
HibernateException
Get a prepared statement for use in loading / querying. If not explicitly
released by closeQueryStatement(), it will be released when the
session is closed or disconnected.
prepareCallableStatement
public CallableStatement prepareCallableStatement(String sql)
throws SQLException,
HibernateException
prepareQueryStatement
public PreparedStatement prepareQueryStatement(String sql,
boolean scrollable,
ScrollMode scrollMode)
throws SQLException,
HibernateException
Get a prepared statement for use in loading / querying. If not explicitly
released by closeQueryStatement(), it will be released when the
session is closed or disconnected.
prepareSelectStatement
public PreparedStatement prepareSelectStatement(String sql)
throws SQLException,
HibernateException
Get a non-batchable prepared statement to use for selecting. Does not
result in execution of the current batch.
prepareStatement
public PreparedStatement prepareStatement(String sql)
throws SQLException,
HibernateException
prepareStatement
public PreparedStatement prepareStatement(String sql,
String[] columnNames)
throws SQLException,
HibernateException
Get a non-batchable prepared statement to use for inserting / deleting / updating.
using JDBC3 getGeneratedKeys (
Connection.prepareStatement(String, String[])
).
Must be explicitly released by
closeStatement(PreparedStatement)
after use.
prepareStatement
public PreparedStatement prepareStatement(String sql,
boolean useGetGeneratedKeys)
throws SQLException,
HibernateException
Get a non-batchable prepared statement to use for inserting / deleting / updating,
using JDBC3 getGeneratedKeys (
Connection.prepareStatement(String, int)
).
Must be explicitly released by
closeStatement(PreparedStatement)
after use.
setTransactionTimeout
public void setTransactionTimeout(int seconds)
Set the transaction timeout to seconds later
than the current system time.
unsetTransactionTimeout
public void unsetTransactionTimeout()
Unset the transaction timeout, called after the end of a
transaction.