mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-01 23:39:15 +00:00
HHH-14289 Detection of JDBC support for RefCursors was returning false even for Oracle JDBC drivers supporting it
This commit is contained in:
parent
ded7fb5814
commit
6745dff121
@ -137,9 +137,17 @@ public ResultSet getResultSet(CallableStatement statement, String name) {
|
|||||||
*/
|
*/
|
||||||
public static boolean supportsRefCursors(DatabaseMetaData meta) {
|
public static boolean supportsRefCursors(DatabaseMetaData meta) {
|
||||||
try {
|
try {
|
||||||
return meta.supportsRefCursors();
|
final boolean mightSupportIt = meta.supportsRefCursors();
|
||||||
|
// Some databases cheat and don't actually support it correctly: add some additional checks.
|
||||||
|
if ( mightSupportIt ) {
|
||||||
|
if ( "Oracle JDBC driver".equals( meta.getDriverName() ) && meta.getDriverMajorVersion() < 19 ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mightSupportIt;
|
||||||
}
|
}
|
||||||
catch (SQLException throwable) {
|
catch (Exception throwable) {
|
||||||
|
//If the driver is not compatible with the Java 8 contract, the method might not exit.
|
||||||
log.debug( "Unexpected error trying to gauge level of JDBC REF_CURSOR support : " + throwable.getMessage() );
|
log.debug( "Unexpected error trying to gauge level of JDBC REF_CURSOR support : " + throwable.getMessage() );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user