SQLException:sqlState规范定义的状态,errorCode具体db的返回码,mysql driver根据sqlState返回具体的SQLException的子类(具体见SQLError类)
JDK 1.6 - JDBC4(判断是否存在java.sql.NClob类):jdbc4定义了SQLException 的多个子类
mysql driver 在jdbc4按子类的实现返回,之前按SQLException的子类返回
jdbc4异常类型分析
SQLRecoverableException(mysql子类 CommunicationsException)
SQLNonTransientException
SQLTransientException
SQLTransientConnectionException
SQLNonTransientConnectionException
业务语法相关异常(NonTransient)
SQLDataException
SQLIntegrityConstraintViolationException
SQLInvalidAuthorizationSpecException
SQLSyntaxErrorException
其它
MySQLQueryInterruptedException(MySQLNonTransientException)
SQLTimeoutException
SQLTransactionRollbackException