Code example for SQLException

Methods: setNextException

0
                stmt.setObject(index, o, Types.BIGINT);
            } else { 
                stmt.setObject(index, o);
            } 
        } catch (Exception e) {
            SQLException cause = null, ex = new SQLException("error setting index [" + index + "]");
 
            if (e instanceof SQLException) {
                cause = (SQLException) e;
            } else { 
                cause = new SQLException(e.getMessage());
            } 
 
            ex.setNextException(cause);
 
            throw ex;
        } 
    } 
 
    /** 
Stop searching for code, let great code find you!  Add Codota to your java IDE