diff SQLSTATEs @ 144:d6abd1ffffbb

Use SQLNonTransientConnectionException instead of SQLException where applicable (SQLState starts with 08) Use SQLDataException instead of SQLException where applicable (SQLState starts with 22) Also updated documentation file: SQLSTATEs which documents the MonetDB JDBC driver specific SQLSTATEs
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 03 Aug 2017 18:53:04 +0200 (2017-08-03)
parents a5a898f6886c
children 5c575fb21be0
line wrap: on
line diff
--- a/SQLSTATEs
+++ b/SQLSTATEs
@@ -1,56 +1,69 @@
-08M01 opening logfile failed
+Following SQLStates are MonetDB JDBC driver specific:
 01M02 redirect warning
-M0M03 illegal arguments (invalid call of internal function)
 01M03 illegal arguments (invalid call of internal function)
-M0M04 only supported in SQL mode
-M1M05 invalid argument (user supplied)
-M0M06 savepoint is not MonetSavepoint
 01M07 unrecognised clientinfo property
 01M08 read-only conection mode not supported
 01M09 transaction mode not supported
-M0M10 protocol violation/unexpected server response
 01M10 unexpected server output
 01M11 server-client autocommit state mismatch
-M0M12 matching client handle referenced by server not found
 01M13 concurrency mode not supported
 01M14 scrolling mode not supported
 01M15 holdability mode not supported
-M1M16 multistatements not supported in batches
-M1M17 result set not expected for DML or DDL-statement
 01M18 generated keys for columns not supported
-M1M19 response is not a result set
-M1M20 object closed
 01M21 cursors not supported
-0AM21 cursors not supported
 01M22 JDBC escape syntax not supported
 01M23 field size limitation not supported
 01M24 query time out not supported
-M1M25 failed reading from/writing to object stream
+
+08M01 opening logfile failed
 08M26 invalid URI
-M0M27 unknown error
+08M33 connection timed out
+
+0AM21 cursors not supported
+0AM34 Java generics not supported
+
 22M28 invalid BLOB format
-M0M29 assert
+22M29 invalid inet format
+22M30 invalid url format
+
+2BM37 dependent objects still exist
+2DM30 autocommit mode active
 3BM30 autocommit mode active
-2DM30 autocommit mode active
+
 42M31 user/role already exists
 42M32 user/role not found
-08M33 connection timeout
-0AM34 Java generics not supported
 42M35 sequence not found
 42M36 cannot restart sequence with NULL
-2BM37 dependent objects still exist
+
+M0M03 illegal arguments (invalid call of internal function)
+M0M04 only supported in SQL mode
+M0M06 savepoint is not MonetSavepoint
+M0M10 protocol violation/unexpected server response
+M0M12 matching client handle referenced by server not found
+M0M27 unknown error
+M0M29 assert
+
+M1M05 invalid argument (user supplied)
+M1M16 multistatements not supported in batches
+M1M17 result set not expected for DML or DDL-statement
+M1M19 response is not a result set
+M1M20 object closed
+M1M25 failed reading from/writing to object stream
 
-TODO:
-JDBC 4.1 suggests the following SQLException subclass mapping:
-NonTransientSQLExeceptions (fails when same operation executed again)
-0A SQLFeatureNotSupportedException
-08 SQLNonTransientConnectionException
-22 SQLDataException
-23 SQLIntegrityConstraintViolationException
-28 SQLInvalidAuthorizationException
-42 SQLSyntaxErrorException
-TransientSQLExeceptions (retry of same operation might succeed)
-08 SQLTransientConnectionException
-40 SQLTransactionRollbackException
-   SQLTimeoutException
+SQLState codes are used in SQLExceptions.
+JDBC 4.1 defines the following SQLException subclass mappings:
+ NonTransientSQLExceptions (fails when same operation executed again)
+   0A SQLFeatureNotSupportedException
+   08 SQLNonTransientConnectionException
+   22 SQLDataException
+   23 SQLIntegrityConstraintViolationException
+   28 SQLInvalidAuthorizationSpecException
+   42 SQLSyntaxErrorException
+ TransientSQLExeceptions (retry of same operation might succeed)
+   08 SQLTransientConnectionException
+   40 SQLTransactionRollbackException
+   null SQLTimeoutException
 
+See also: http://docs.oracle.com/javase/7/docs/api/java/sql/SQLException.html
+See also: https://en.wikibooks.org/wiki/Structured_Query_Language/SQLSTATE
+