Class ResultSetReturnImpl
- java.lang.Object
-
- org.hibernate.engine.jdbc.internal.ResultSetReturnImpl
-
- All Implemented Interfaces:
ResultSetReturn
public class ResultSetReturnImpl extends Object implements ResultSetReturn
Standard implementation of the ResultSetReturn contract
-
-
Constructor Summary
Constructors Constructor Description ResultSetReturnImpl(JdbcCoordinator jdbcCoordinator, JdbcServices jdbcServices)
Constructs a ResultSetReturnImpl
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultSet
execute(PreparedStatement statement)
Execute thePreparedStatement
return its firstResultSet
, if any.ResultSet
execute(PreparedStatement statement, String sql)
Execute thePreparedStatement
return its firstResultSet
, if any.ResultSet
execute(Statement statement, String sql)
Performs the given SQL statement, returning its firstResultSet
, if any.int
executeUpdate(PreparedStatement statement)
Execute thePreparedStatement
, returning its "affected row count".int
executeUpdate(PreparedStatement statement, String sql)
Execute thePreparedStatement
, returning its "affected row count".int
executeUpdate(Statement statement, String sql)
Execute the given SQL statement returning its "affected row count".ResultSet
extract(CallableStatement callableStatement)
Extract theResultSet
from theCallableStatement
.ResultSet
extract(PreparedStatement statement)
Extract theResultSet
from thePreparedStatement
.ResultSet
extract(PreparedStatement statement, String sql)
Extract theResultSet
from thePreparedStatement
.ResultSet
extract(Statement statement, String sql)
Performs the given SQL statement, expecting aResultSet
in return
-
-
-
Constructor Detail
-
ResultSetReturnImpl
public ResultSetReturnImpl(JdbcCoordinator jdbcCoordinator, JdbcServices jdbcServices)
Constructs a ResultSetReturnImpl- Parameters:
jdbcCoordinator
- The JdbcCoordinator
-
-
Method Detail
-
extract
public ResultSet extract(PreparedStatement statement)
Description copied from interface:ResultSetReturn
Extract theResultSet
from thePreparedStatement
.If client passes
CallableStatement
reference, this method callsResultSetReturn.extract(CallableStatement)
internally. Otherwise,PreparedStatement.executeQuery()
is called.- Specified by:
extract
in interfaceResultSetReturn
- Parameters:
statement
- ThePreparedStatement
from which to extract theResultSet
- Returns:
- The extracted ResultSet
-
extract
public ResultSet extract(PreparedStatement statement, String sql)
Description copied from interface:ResultSetReturn
Extract theResultSet
from thePreparedStatement
.If client passes
CallableStatement
reference, this method callsResultSetReturn.extract(CallableStatement)
internally. Otherwise,PreparedStatement.executeQuery()
is called.- Specified by:
extract
in interfaceResultSetReturn
- Parameters:
statement
- ThePreparedStatement
from which to extract theResultSet
- Returns:
- The extracted
ResultSet
-
extract
public ResultSet extract(CallableStatement callableStatement)
Description copied from interface:ResultSetReturn
Extract theResultSet
from theCallableStatement
. Note that this is the limited legacy form which delegates toDialect.getResultSet(java.sql.CallableStatement)
. Better option is to integrateProcedureCall
-like hooks- Specified by:
extract
in interfaceResultSetReturn
- Parameters:
callableStatement
- TheCallableStatement
from which to extract theResultSet
- Returns:
- The extracted
ResultSet
-
extract
public ResultSet extract(Statement statement, String sql)
Description copied from interface:ResultSetReturn
Performs the given SQL statement, expecting aResultSet
in return- Specified by:
extract
in interfaceResultSetReturn
- Parameters:
statement
- The JDBCStatement
object to usesql
- The SQL to execute- Returns:
- The resulting
ResultSet
-
execute
public ResultSet execute(PreparedStatement statement)
Description copied from interface:ResultSetReturn
Execute thePreparedStatement
return its firstResultSet
, if any. If there is noResultSet
, returnsnull
- Specified by:
execute
in interfaceResultSetReturn
- Parameters:
statement
- ThePreparedStatement
to execute- Returns:
- The extracted
ResultSet
, ornull
-
execute
public ResultSet execute(PreparedStatement statement, String sql)
Description copied from interface:ResultSetReturn
Execute thePreparedStatement
return its firstResultSet
, if any. If there is noResultSet
, returnsnull
- Specified by:
execute
in interfaceResultSetReturn
- Parameters:
statement
- ThePreparedStatement
to executesql
- For error reporting- Returns:
- The extracted
ResultSet
, ornull
-
execute
public ResultSet execute(Statement statement, String sql)
Description copied from interface:ResultSetReturn
Performs the given SQL statement, returning its firstResultSet
, if any. If there is noResultSet
, returnsnull
- Specified by:
execute
in interfaceResultSetReturn
- Parameters:
statement
- The JDBCStatement
object to usesql
- The SQL to execute- Returns:
- The extracted
ResultSet
, ornull
-
executeUpdate
public int executeUpdate(PreparedStatement statement)
Description copied from interface:ResultSetReturn
Execute thePreparedStatement
, returning its "affected row count".- Specified by:
executeUpdate
in interfaceResultSetReturn
- Parameters:
statement
- ThePreparedStatement
to execute- Returns:
- The
PreparedStatement.executeUpdate()
result
-
executeUpdate
public int executeUpdate(PreparedStatement statement, String sql)
Description copied from interface:ResultSetReturn
Execute thePreparedStatement
, returning its "affected row count".- Specified by:
executeUpdate
in interfaceResultSetReturn
- Parameters:
statement
- ThePreparedStatement
to executesql
- For error reporting- Returns:
- The
PreparedStatement.executeUpdate()
result
-
executeUpdate
public int executeUpdate(Statement statement, String sql)
Description copied from interface:ResultSetReturn
Execute the given SQL statement returning its "affected row count".- Specified by:
executeUpdate
in interfaceResultSetReturn
- Parameters:
statement
- The JDBCStatement
object to usesql
- The SQL to execute- Returns:
- The
Statement.executeUpdate(String)
result
-
-