Code example for SQLWarning

0
    public static SQLException connectionClosedException() {
        return sqlException(ErrorCode.X_08003); 
    } 
 
    public static SQLWarning sqlWarning(Result r) {
        return new SQLWarning(r.getMainString(), r.getSubString(),
                              r.getErrorCode());
    } 
 
    public static SQLException sqlException(Throwable t) {
 
//#ifdef JAVA6 
        return new SQLNonTransientConnectionException(t);
 
//#else 
/* 
        return new SQLException(t.getMessage(), 
                                Error.getStateString(ErrorCode.GENERAL_ERROR), 
                                ErrorCode.GENERAL_ERROR); 
*/