Skip to content

Commit 4ae9f91

Browse files
committed
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 4ba88fb commit 4ae9f91

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/org/tarantool/jdbc/SQLDatabaseMetadata.java

Lines changed: 1 addition & 1 deletion
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

src/test/java/org/tarantool/jdbc/JdbcDatabaseMetaDataIT.java

Lines changed: 5 additions & 0 deletions
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)