FileDocCategorySizeDatePackage
Batcher.javaAPI DocHibernate 3.2.55923Thu Jun 22 14:51:44 BST 2006org.hibernate.jdbc

Batcher

public interface Batcher
Manages PreparedStatements for a session. Abstracts JDBC batching to maintain the illusion that a single logical batch exists for the whole session, even when batching is disabled. Provides transparent PreparedStatement caching.
see
java.sql.PreparedStatement
see
org.hibernate.impl.SessionImpl
author
Gavin King

Fields Summary
Constructors Summary
Methods Summary
public voidabortBatch(java.sql.SQLException sqle)
Must be called when an exception occurs

param
sqle the (not null) exception that is the reason for aborting

public voidaddToBatch(Expectation expectation)
Add an insert / delete / update to the current batch (might be called multiple times for single prepareBatchStatement())

public voidcancelLastQuery()
Cancel the current query statement

public voidcloseConnection(java.sql.Connection conn)
Dispose of the JDBC connection

public voidcloseQueryStatement(java.sql.PreparedStatement ps, java.sql.ResultSet rs)
Close a prepared statement opened with prepareQueryStatement()

public voidcloseStatement(java.sql.PreparedStatement ps)
Close a prepared or callable statement opened using prepareStatement() or prepareCallableStatement()

public voidcloseStatements()
Close any query statements that were left lying around

public voidexecuteBatch()
Execute the batch

public java.sql.ResultSetgetResultSet(java.sql.PreparedStatement ps)
Execute the statement and return the result set

public java.sql.ResultSetgetResultSet(java.sql.CallableStatement ps, org.hibernate.dialect.Dialect dialect)
Execute the statement and return the result set from a callable statement

public booleanhasOpenResources()

public java.sql.ConnectionopenConnection()
Obtain a JDBC connection

public java.lang.StringopenResourceStatsAsString()

public java.sql.CallableStatementprepareBatchCallableStatement(java.lang.String sql)
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.

see
Batcher#addToBatch

public java.sql.PreparedStatementprepareBatchStatement(java.lang.String sql)
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.

see
Batcher#addToBatch

public java.sql.CallableStatementprepareCallableQueryStatement(java.lang.String sql, boolean scrollable, org.hibernate.ScrollMode scrollMode)
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.

public java.sql.CallableStatementprepareCallableStatement(java.lang.String sql)
Get a non-batchable callable statement to use for inserting / deleting / updating.

Must be explicitly released by {@link #closeStatement} after use.

public java.sql.PreparedStatementprepareQueryStatement(java.lang.String sql, boolean scrollable, org.hibernate.ScrollMode scrollMode)
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.

public java.sql.PreparedStatementprepareSelectStatement(java.lang.String sql)
Get a non-batchable prepared statement to use for selecting. Does not result in execution of the current batch.

public java.sql.PreparedStatementprepareStatement(java.lang.String sql, boolean useGetGeneratedKeys)
Get a non-batchable prepared statement to use for inserting / deleting / updating, using JDBC3 getGeneratedKeys ({@link Connection#prepareStatement(String, int)}).

Must be explicitly released by {@link #closeStatement} after use.

public java.sql.PreparedStatementprepareStatement(java.lang.String sql, java.lang.String[] columnNames)
Get a non-batchable prepared statement to use for inserting / deleting / updating. using JDBC3 getGeneratedKeys ({@link Connection#prepareStatement(String, String[])}).

Must be explicitly released by {@link #closeStatement} after use.

public java.sql.PreparedStatementprepareStatement(java.lang.String sql)
Get a non-batchable prepared statement to use for inserting / deleting / updating.

Must be explicitly released by {@link #closeStatement} after use.

public voidsetTransactionTimeout(int seconds)
Set the transaction timeout to seconds later than the current system time.

public voidunsetTransactionTimeout()
Unset the transaction timeout, called after the end of a transaction.