Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.2.x' into 4.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nvoxland committed Dec 9, 2020
2 parents 6250ef5 + 23e0d1c commit a5a01b5
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ protected String getDefaultDatabaseProductName() {
@Override
public boolean isCorrectDatabaseImplementation(DatabaseConnection conn) throws DatabaseException {
if (conn instanceof JdbcConnection) {
try (Statement stmt = ((JdbcConnection) conn).createStatement();
ResultSet rs = stmt.executeQuery("select version()")
) {
if (rs.next()) {
return ((String) JdbcUtils.getResultSetValue(rs, 1)).startsWith("CockroachDB");
try (Statement stmt = ((JdbcConnection) conn).createStatement()) {
if (stmt != null) {
try (ResultSet rs = stmt.executeQuery("select version()")) {
if (rs.next()) {
return ((String) JdbcUtils.getResultSetValue(rs, 1)).startsWith("CockroachDB");
}
}
}
} catch (SQLException throwables) {
return false;
Expand Down

0 comments on commit a5a01b5

Please sign in to comment.