HHH-18332 Fix DB2 support for procedure output ref_cursors parameters
This commit is contained in:
parent
4c64ddc153
commit
f292908b67
|
@ -777,11 +777,24 @@ public class DB2LegacyDialect extends Dialect {
|
|||
return "nullif(" + literal + "," + literal + ')';
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean supportsRefCursors() {
|
||||
// DB2 supports the binding with Types.REF_CURSOR but doesn't support statement.getObject(position, ResultSet.class)
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException {
|
||||
statement.registerOutParameter( col++, Types.REF_CURSOR );
|
||||
return col;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int registerResultSetOutParameter(CallableStatement statement, String name) throws SQLException {
|
||||
statement.registerOutParameter( name, Types.REF_CURSOR );
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getResultSet(CallableStatement ps) throws SQLException {
|
||||
boolean isResultSet = ps.execute();
|
||||
|
@ -793,6 +806,16 @@ public class DB2LegacyDialect extends Dialect {
|
|||
return ps.getResultSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getResultSet(CallableStatement statement, int position) throws SQLException {
|
||||
return (ResultSet) statement.getObject( position );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getResultSet(CallableStatement statement, String name) throws SQLException {
|
||||
return (ResultSet) statement.getObject( name );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCommentOn() {
|
||||
return true;
|
||||
|
|
|
@ -851,11 +851,24 @@ public class DB2Dialect extends Dialect {
|
|||
return "nullif(" + literal + "," + literal + ')';
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean supportsRefCursors() {
|
||||
// DB2 supports the binding with Types.REF_CURSOR but doesn't support statement.getObject(position, ResultSet.class)
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException {
|
||||
statement.registerOutParameter( col++, Types.REF_CURSOR );
|
||||
return col;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int registerResultSetOutParameter(CallableStatement statement, String name) throws SQLException {
|
||||
statement.registerOutParameter( name, Types.REF_CURSOR );
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getResultSet(CallableStatement ps) throws SQLException {
|
||||
boolean isResultSet = ps.execute();
|
||||
|
@ -867,6 +880,16 @@ public class DB2Dialect extends Dialect {
|
|||
return ps.getResultSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getResultSet(CallableStatement statement, int position) throws SQLException {
|
||||
return (ResultSet) statement.getObject( position );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSet getResultSet(CallableStatement statement, String name) throws SQLException {
|
||||
return (ResultSet) statement.getObject( name );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsCommentOn() {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue