mirror of https://github.com/apache/openjpa.git
Put getJDBCMajorVersion() in a try/catch block, since it is a JDBC 3-only method, so it might throw an AnstractMethodError.
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@495027 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c6121be583
commit
9851f62748
|
@ -148,11 +148,20 @@ public class DB2Dictionary
|
|||
return conn;
|
||||
}
|
||||
|
||||
private boolean isJDBC3(DatabaseMetaData meta) {
|
||||
try {
|
||||
// JDBC3-only method, so it might throw a AbstractMethodError
|
||||
return meta.getJDBCMajorVersion() >= 3;
|
||||
} catch (Throwable t) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void connectedConfiguration(Connection conn) throws SQLException {
|
||||
super.connectedConfiguration(conn);
|
||||
|
||||
DatabaseMetaData metaData = conn.getMetaData();
|
||||
if (metaData.getJDBCMajorVersion() >= 3) {
|
||||
if (isJDBC3(metaData)) {
|
||||
int maj = metaData.getDatabaseMajorVersion();
|
||||
int min = metaData.getDatabaseMinorVersion();
|
||||
|
||||
|
|
Loading…
Reference in New Issue