Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/drizzle/jdbc/CommonDatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -2419,7 +2419,7 @@ public int getResultSetHoldability() throws SQLException {
* @since 1.4
*/
public int getDatabaseMajorVersion() throws SQLException {
return 0;
return Integer.parseInt(version.split("\\.")[0]);
}

/**
Expand All @@ -2430,7 +2430,7 @@ public int getDatabaseMajorVersion() throws SQLException {
* @since 1.4
*/
public int getDatabaseMinorVersion() throws SQLException {
return 1;
return version.split("\\.").length > 1 ? Integer.parseInt(version.split("\\.")[1]) : 0 ;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/drizzle/jdbc/DrizzleConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ public void setTransactionIsolation(final int level) throws SQLException {
public int getTransactionIsolation() throws SQLException {
final Statement stmt = createStatement();
try {
final ResultSet rs = stmt.executeQuery("SELECT @@tx_isolation");
String tx_isolation = Integer.parseInt(protocol.getServerVersion().split("\\.")[0]) >= 8 ? "SELECT @@transaction_isolation":"SELECT @@tx_isolation" ;
final ResultSet rs = stmt.executeQuery(tx_isolation);
rs.next();
final String response = rs.getString(1);
if (response.equals("REPEATABLE-READ")) {
Expand Down