Code example for SQLException

Methods: setNextException

0
    public void setJDBCObject(PreparedStatement stmt, int index, PyObject object) throws SQLException {
 
        try { 
            stmt.setObject(index, object.__tojava__(Object.class));
        } 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;
        } 
    } 
 
    /**