HHH-10256 - ClassCastException in ResultSetReturnImpl.java:75

This commit is contained in:
Vlad Mihalcea 2017-02-13 16:48:43 +02:00
parent 8b2a852a92
commit 3adb0d76be
3 changed files with 17 additions and 9 deletions

View File

@ -18,6 +18,12 @@ dependencies {
testRuntime( libraries.expression_language_api )
testRuntime( libraries.expression_language_impl )
if (db.equalsIgnoreCase("oracle")) {
dependencies {
testRuntime( libraries.oracle )
}
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Java 9 ftw!
if ( JavaVersion.current().isJava9Compatible() ) {

View File

@ -55,15 +55,16 @@ public class ResultSetReturnImpl implements ResultSetReturn {
@Override
public ResultSet extract(PreparedStatement statement) {
// IMPL NOTE : SQL logged by caller
if ( isTypeOf( statement, CallableStatement.class ) ) {
// We actually need to extract from Callable statement. Although
// this seems needless, Oracle can return an
// OracleCallableStatementWrapper that finds its way to this method,
// rather than extract(CallableStatement). See HHH-8022.
final CallableStatement callableStatement = (CallableStatement) statement;
return extract( callableStatement );
}
try {
if ( isTypeOf( statement, CallableStatement.class ) ) {
// We actually need to extract from Callable statement. Although
// this seems needless, Oracle can return an
// OracleCallableStatementWrapper that finds its way to this method,
// rather than extract(CallableStatement). See HHH-8022.
final CallableStatement callableStatement = statement.unwrap( CallableStatement.class );
return extract( callableStatement );
}
final ResultSet rs;
try {
jdbcExecuteStatementStart();

View File

@ -96,7 +96,8 @@ ext {
postgresql: 'org.postgresql:postgresql:9.4-1202-jdbc41',
mysql: 'mysql:mysql-connector-java:6.0.5',
mariadb: 'org.mariadb.jdbc:mariadb-java-client:1.1.7',
oracle: 'com.oracle.ojdbc:ojdbc7:12.1.0.2.0',
oracle: 'com.oracle.jdbc:ojdbc7:12.1.0.2',
mssql: 'com.microsoft.sqlserver:mssql-jdbc:6.1.0.jre8',
informix: 'com.ibm.informix:jdbc:4.10.7.20160517',