Code example for SQLException

0
     
    public static final ErrorType errorType = new ErrorType("error.db.queryfailed",  "Error executing query {0}.\r\nNative error is {0}."); 
     
    public QueryFailedException(DBObject obj, String sqlCmd, SQLException cause) 
    { 
        super(errorType, new Object[] { sqlCmd, InternalSQLException.messageFromSQLException(InternalSQLException.driverFromObject(obj), cause) }, cause); 
    } 
     
    /** 
     * log the error 
     */ 
    @Override 
    protected void log() 
    { 
       if ( log.isErrorEnabled() ) 
            log.error(getMessage()); 
       else 
           super.log(); 
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java