If errors occur, exceptions of the following classes can be triggered.
Exceptions
Exception |
Meaning |
com.sap.dbtech.jdbc.exceptions.DatabaseException |
Error when executing an SQL statement |
com.sap.dbtech.jdbc.exceptions.InternalJDBCError |
Error in the internal data of the JDBC driver |
com.sap.dbtech.jdbc.exceptions.InvalidArgumentValue |
Invalid parameter value sent to a method |
com.sap.dbtech.jdbc.exceptions.InvalidColumnException |
Invalid column of an object in the class ResultSet accessed |
com.sap.dbtech.jdbc.exceptions.JDBCDriverException |
Error that was noticed by the JDBC driver |
com.sap.dbtech.jdbc.exceptions.NotSupportedException |
Attribute is not supported by the JDBC driver |
com.sap.dbtech.jdbc.exceptions.ObjectIsClosedException |
Object in the class Connection, Statement, or ResultSet accessed after method close called for this object. |
com.sap.dbtech.jdbc.exceptions.PrepareExecution |
Error when preparing an SQL statement |
com.sap.dbtech.jdbc.translators.ConversionExceptionSapDB |
Error when converting between Java and SQL data types |
All classes are subclasses of the java.sql.SQLException class.
This means that if you want to write JDBC code which is independent of the database product, you do not need to query the above exceptions explicitly in a catch statement. Instead, you only need to query exceptions of the class java.sql.SQLException.