Fix #185 additional checks for AbstractMethodError

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

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

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

Loading…
Cancel
Save