Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » jdbc » [javadoc | source]
org.hibernate.jdbc
public interface: Batcher [javadoc | source]

All Known Implementing Classes:
    NonBatchingBatcher, AbstractBatcher, BatchingBatcher

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.
Method from org.hibernate.jdbc.Batcher Summary:
abortBatch,   addToBatch,   cancelLastQuery,   closeConnection,   closeQueryStatement,   closeStatement,   closeStatements,   executeBatch,   getResultSet,   getResultSet,   hasOpenResources,   openConnection,   openResourceStatsAsString,   prepareBatchCallableStatement,   prepareBatchStatement,   prepareCallableQueryStatement,   prepareCallableStatement,   prepareQueryStatement,   prepareSelectStatement,   prepareStatement,   prepareStatement,   prepareStatement,   setTransactionTimeout,   unsetTransactionTimeout
Method from org.hibernate.jdbc.Batcher Detail:
 public  void abortBatch(SQLException sqle)
    Must be called when an exception occurs
 public  void addToBatch(Expectation expectation) throws HibernateException, SQLException
    Add an insert / delete / update to the current batch (might be called multiple times for single prepareBatchStatement())
 public  void cancelLastQuery() throws HibernateException
    Cancel the current query statement
 public  void closeConnection(Connection conn) throws HibernateException
    Dispose of the JDBC connection
 public  void closeQueryStatement(PreparedStatement ps,
    ResultSet rs) throws SQLException
    Close a prepared statement opened with prepareQueryStatement()
 public  void closeStatement(PreparedStatement ps) throws SQLException
    Close a prepared or callable statement opened using prepareStatement() or prepareCallableStatement()
 public  void closeStatements()
    Close any query statements that were left lying around
 public  void executeBatch() throws HibernateException
    Execute the batch
 public ResultSet getResultSet(PreparedStatement ps) throws SQLException
    Execute the statement and return the result set
 public ResultSet getResultSet(CallableStatement ps,
    Dialect dialect) throws SQLException
    Execute the statement and return the result set from a callable statement
 public boolean hasOpenResources()
 public Connection openConnection() throws HibernateException
    Obtain a JDBC connection
 public String openResourceStatsAsString()
 public CallableStatement prepareBatchCallableStatement(String sql) throws HibernateException, SQLException
    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.
 public PreparedStatement prepareBatchStatement(String sql) throws HibernateException, SQLException
    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.
 public CallableStatement prepareCallableQueryStatement(String sql,
    boolean scrollable,
    ScrollMode scrollMode) throws HibernateException, SQLException
    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 CallableStatement prepareCallableStatement(String sql) throws HibernateException, SQLException
    Get a non-batchable callable statement to use for inserting / deleting / updating.

    Must be explicitly released by #closeStatement after use.

 public PreparedStatement prepareQueryStatement(String sql,
    boolean scrollable,
    ScrollMode scrollMode) throws HibernateException, SQLException
    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 PreparedStatement prepareSelectStatement(String sql) throws HibernateException, SQLException
    Get a non-batchable prepared statement to use for selecting. Does not result in execution of the current batch.
 public PreparedStatement prepareStatement(String sql) throws HibernateException, SQLException
    Get a non-batchable prepared statement to use for inserting / deleting / updating.

    Must be explicitly released by #closeStatement after use.

 public PreparedStatement prepareStatement(String sql,
    boolean useGetGeneratedKeys) throws HibernateException, SQLException
 public PreparedStatement prepareStatement(String sql,
    String[] columnNames) throws HibernateException, SQLException
 public  void setTransactionTimeout(int seconds)
    Set the transaction timeout to seconds later than the current system time.
 public  void unsetTransactionTimeout()
    Unset the transaction timeout, called after the end of a transaction.