Fix #185 additional checks for AbstractMethodError

pull/190/head
Brett Wooldridge 11 years ago
parent 80851e54de
commit 546230c3bd

@ -265,8 +265,7 @@ public final class PoolUtilities
jdbc41checked = true; jdbc41checked = true;
try { try {
connection.getNetworkTimeout(); // This will throw AbstractMethodError or SQLException in the case of a non-JDBC 41 compliant driver IS_JDBC41 = connection.getNetworkTimeout() != Integer.MIN_VALUE; // This will throw AbstractMethodError or SQLException in the case of a non-JDBC 41 compliant driver
IS_JDBC41 = true;
} }
catch (SQLFeatureNotSupportedException e) { catch (SQLFeatureNotSupportedException e) {
IS_JDBC41 = false; IS_JDBC41 = false;
@ -329,6 +328,12 @@ public final class PoolUtilities
catch (SQLFeatureNotSupportedException e) { catch (SQLFeatureNotSupportedException e) {
IS_JDBC41 = false; IS_JDBC41 = false;
} }
catch (AbstractMethodError e) {
IS_JDBC41 = false;
}
catch (NoSuchMethodError e) {
IS_JDBC41 = false;
}
} }
return 0; return 0;

@ -241,8 +241,7 @@ public final class PoolUtilities
jdbc41checked = true; jdbc41checked = true;
try { try {
connection.getNetworkTimeout(); // This will throw AbstractMethodError or SQLException in the case of a non-JDBC 41 compliant driver IS_JDBC41 = connection.getNetworkTimeout() != Integer.MIN_VALUE; // This will throw AbstractMethodError or SQLException in the case of a non-JDBC 41 compliant driver
IS_JDBC41 = true;
} }
catch (NoSuchMethodError | AbstractMethodError | SQLFeatureNotSupportedException e) { catch (NoSuchMethodError | AbstractMethodError | SQLFeatureNotSupportedException e) {
IS_JDBC41 = false; IS_JDBC41 = false;
@ -290,7 +289,7 @@ public final class PoolUtilities
connection.setNetworkTimeout(executor, (int) timeoutMs); connection.setNetworkTimeout(executor, (int) timeoutMs);
return networkTimeout; return networkTimeout;
} }
catch (SQLFeatureNotSupportedException e) { catch (SQLFeatureNotSupportedException | AbstractMethodError | NoSuchMethodError e) {
IS_JDBC41 = false; IS_JDBC41 = false;
} }
} }

Loading…
Cancel
Save