Package org.hibernate.engine.jdbc.spi
Interface ResultSetReturn
-
public interface ResultSetReturnContract for extracting ResultSets from Statements, executing Statements, managing Statement/ResultSet resources, and logging statement calls. TODO: This could eventually utilize the new Return interface. It would be great to have a common API shared. Generally the methods here dealing with CallableStatement are extremely limited, relying on the legacy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResultSetexecute(PreparedStatement statement)Execute the PreparedStatement return its first ResultSet, if any.ResultSetexecute(Statement statement, String sql)Performs the given SQL statement, returning its first ResultSet, if any.intexecuteUpdate(PreparedStatement statement)Execute the PreparedStatement, returning its "affected row count".intexecuteUpdate(Statement statement, String sql)Execute the given SQL statement returning its "affected row count".ResultSetextract(CallableStatement callableStatement)Extract the ResultSet from the CallableStatement.ResultSetextract(PreparedStatement statement)Extract the ResultSet from the PreparedStatement.ResultSetextract(Statement statement, String sql)Performs the given SQL statement, expecting a ResultSet in return
-
-
-
Method Detail
-
extract
ResultSet extract(PreparedStatement statement)
Extract the ResultSet from the PreparedStatement. If user passesCallableStatementreference, this method callsextract(CallableStatement)internally. Otherwise, generally speaking,PreparedStatement.executeQuery()is called- Parameters:
statement- The PreparedStatement from which to extract the ResultSet- Returns:
- The extracted ResultSet
-
extract
ResultSet extract(CallableStatement callableStatement)
Extract the ResultSet from the CallableStatement. Note that this is the limited legacy form which delegates toDialect.getResultSet(java.sql.CallableStatement). Better option is to integrateProcedureCall-like hooks- Parameters:
callableStatement- The CallableStatement from which to extract the ResultSet- Returns:
- The extracted ResultSet
-
extract
ResultSet extract(Statement statement, String sql)
Performs the given SQL statement, expecting a ResultSet in return- Parameters:
statement- The JDBC Statement object to usesql- The SQL to execute- Returns:
- The resulting ResultSet
-
execute
ResultSet execute(PreparedStatement statement)
Execute the PreparedStatement return its first ResultSet, if any. If there is no ResultSet, returnsnull- Parameters:
statement- The PreparedStatement to execute- Returns:
- The extracted ResultSet, or
null
-
execute
ResultSet execute(Statement statement, String sql)
Performs the given SQL statement, returning its first ResultSet, if any. If there is no ResultSet, returnsnull- Parameters:
statement- The JDBC Statement object to usesql- The SQL to execute- Returns:
- The extracted ResultSet, or
null
-
executeUpdate
int executeUpdate(PreparedStatement statement)
Execute the PreparedStatement, returning its "affected row count".- Parameters:
statement- The PreparedStatement to execute- Returns:
- The
PreparedStatement.executeUpdate()result
-
executeUpdate
int executeUpdate(Statement statement, String sql)
Execute the given SQL statement returning its "affected row count".- Parameters:
statement- The JDBC Statement object to usesql- The SQL to execute- Returns:
- The
Statement.executeUpdate(String)result
-
-