Skip to content

Commit 545fd9a

Browse files
nicktorwaldTotktonada
authored andcommitted
jdbc: support for DatabaseMetaData.getSQLStateType
Now we use SQLSTATE codes in most of the exceptional cases. To be consistent with it we need to return an appropriate value from the database metadata. This commit changes the constant that says the driver works with SQLSTATE codes rather than XOpen ones. Closes #119
1 parent 7ebd4f2 commit 545fd9a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: src/main/java/org/tarantool/jdbc/SQLDatabaseMetadata.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ public int getJDBCMinorVersion() throws SQLException {
10371037

10381038
@Override
10391039
public int getSQLStateType() throws SQLException {
1040-
return 0;
1040+
return DatabaseMetaData.sqlStateSQL;
10411041
}
10421042

10431043
@Override

Diff for: src/test/java/org/tarantool/jdbc/JdbcDatabaseMetaDataIT.java

+5
Original file line numberDiff line numberDiff line change
@@ -390,4 +390,9 @@ public void testDeleteDetectionSupport() throws SQLException {
390390
}
391391
}
392392

393+
@Test
394+
public void testSqlStateType() throws SQLException {
395+
assertEquals(DatabaseMetaData.sqlStateSQL, meta.getSQLStateType());
396+
}
397+
393398
}

0 commit comments

Comments
 (0)