Re: Exception Subtypes
Posted by: Todd Farmer
Date: November 05, 2013 04:13PM

Hi Steve,

com.mysql.jdbc.exceptions.MySQLTransientException extends SQLException rather than SQLTransientException because the latter was introduced in JDBC 4.0 (Java 1.6):

http://docs.oracle.com/javase/6/docs/api/java/sql/SQLTransientException.html

Connector/J supports both JDBC 3 and JDBC 4, and discovers which runtime you are using dynamically. What you are looking for is found in com.mysql.jdbc.exceptions.jdbc4.MySQLTransientException:

public class MySQLTransientException extends SQLTransientException ...

If you're curious about how Connector/J does discovery of the JRE in use, look at the static block in com.mysql.jdbc.ConnectionImpl, which calls com.mysql.jdbc.Util's isJdbc4() method.

Hope that helps!

--
Todd Farmer
MySQL @ Oracle
http://www.oracle.com/mysql/

Options: ReplyQuote


Subject
Written By
Posted
November 05, 2013 03:38PM
Re: Exception Subtypes
November 05, 2013 04:13PM
November 05, 2013 05:51PM
November 06, 2013 09:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.