Code example for JDBCException

Methods: getErrorCodegetSQLgetSQLState, getMessage

0
 */ 
@SuppressWarnings("serial") 
public class HibernateJdbcException extends UncategorizedDataAccessException {
 
	public HibernateJdbcException(JDBCException ex) {
		super("JDBC exception on Hibernate data access: SQLException for SQL [" + ex.getSQL() + "]; SQL state [" +
				ex.getSQLState() + "]; error code [" + ex.getErrorCode() + "]; " + ex.getMessage(), ex);
	} 
 
	/** 
	 * Return the underlying SQLException. 
	 */ 
	public SQLException getSQLException() {
		return ((JDBCException) getCause()).getSQLException();
	} 
 
	/** 
	 * Return the SQL that led to the problem. 
	 */ 
	public String getSql() {