Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
It seems that many JDBC methods throw exceptions of type UnsupportedOperationException or RuntimeException to indicate that they are not applicable (e.g., Drill's implementation of Connection.commit(), since Drill isn't transactional) or not implemented yet (and some throw other {{RuntimeException}}s to indicate other problems ).
However, these methods should be throwing exceptions of type SQLException (or subclasses thereof).
The JDBC pattern is to throw {{SQLException}}s, not {{RuntimeException}}s, so JDBC client code is not likely to handle {{RuntimeException}}s well.
(For example, it is suspected that Connection.commit()'s throwing of UnsupportedOperationException is causing a hang in the JDBC client Spotfire.)
JDBC does provide a SQLFeatureNotSupportedException. However, it is specified to be for when "the JDBC driver does does not support an optional JDBC feature." It's not clear how risky it would be to use this exception when Drill does not support a non-optional JDBC feature.
(Possibly, some methods that can't really do what JDBC specifies might need to just return silently without throwing any exception.)
Attachments
Attachments
Issue Links
- is depended upon by
-
DRILL-3766 ResultSet.getRow() returns incorrect row number of current row
-
- Resolved
-
- is related to
-
DRILL-2445 JDBC : Connection.rollback method currently throws UnsuportedOperationException
-
- Resolved
-
-
DRILL-2451 JDBC : Connection.commit throws an UnsupportedOperationException
-
- Resolved
-
-
CALCITE-585 Avatica JDBC methods should throw SQLFeatureNotSupportedException
-
- Closed
-
- is required by
-
DRILL-2472 JDBC : ResultSet.wasNull should give proper error message when a user tries to call it before calling getXXX method
-
- Resolved
-
- requires
-
DRILL-2489 Accessing Connection, Statement, PreparedStatement after they are closed should throw a SQLException
-
- Reviewable
-
- supercedes
-
DRILL-2555 JDBC driver throws RuntimeExceptions rather than SQLExceptions
-
- Resolved
-
- links to