/** * Checks that the result set is not closed, it's positioned on a * valid row and that the given column number is valid. Also * updates the {@link #wasNullFlag} to correct value. * * @param column The column number to check. Range starts from 1. * @throws SQLException If state or column is invalid. */ protected void checkResultSet( int column ) throws SQLException { checkClosed(); if ( this_row == null ) throw new PSQLException(GT.tr("ResultSet not positioned properly, perhaps you need to call next."), PSQLState.INVALID_CURSOR_STATE); checkColumnIndex(column); wasNullFlag = (this_row[column - 1] == null); }
public synchronized void updateNull(int columnIndex) throws SQLException { checkColumnIndex(columnIndex); String columnTypeName = connection.getTypeInfo().getPGType(fields[columnIndex - 1].getOID()); updateValue(columnIndex, new NullObject(columnTypeName)); }
protected void updateValue(int columnIndex, Object value) throws SQLException { checkUpdateable(); if (!onInsertRow && (isBeforeFirst() || isAfterLast() || rows.size() == 0)) { throw new PSQLException(GT.tr("Cannot update the ResultSet because it is either before the start or after the end of the results."), PSQLState.INVALID_CURSOR_STATE); } checkColumnIndex(columnIndex); doingUpdates = !onInsertRow; if (value == null) { updateNull(columnIndex); } else { PGResultSetMetaData md = (PGResultSetMetaData)getMetaData(); updateValues.put(md.getBaseColumnName(columnIndex), value); } }
/** * Checks that the result set is not closed, it's positioned on a * valid row and that the given column number is valid. Also * updates the {@link #wasNullFlag} to correct value. * * @param column The column number to check. Range starts from 1. * @throws SQLException If state or column is invalid. */ protected void checkResultSet( int column ) throws SQLException { checkClosed(); if ( this_row == null ) throw new PSQLException(GT.tr("ResultSet not positioned properly, perhaps you need to call next."), PSQLState.INVALID_CURSOR_STATE); checkColumnIndex(column); wasNullFlag = (this_row[column - 1] == null); }
/** * Checks that the result set is not closed, it's positioned on a * valid row and that the given column number is valid. Also * updates the {@link #wasNullFlag} to correct value. * * @param column The column number to check. Range starts from 1. * @throws SQLException If state or column is invalid. */ protected void checkResultSet( int column ) throws SQLException { checkClosed(); if ( this_row == null ) throw new PSQLException(GT.tr("ResultSet not positioned properly, perhaps you need to call next."), PSQLState.INVALID_CURSOR_STATE); checkColumnIndex(column); wasNullFlag = (this_row[column - 1] == null); }
protected void updateValue(int columnIndex, Object value) throws SQLException { checkUpdateable(); if (!onInsertRow && (isBeforeFirst() || isAfterLast() || rows.size() == 0)) { throw new PSQLException(GT.tr("Cannot update the ResultSet because it is either before the start or after the end of the results."), PSQLState.INVALID_CURSOR_STATE); } checkColumnIndex(columnIndex); doingUpdates = !onInsertRow; if (value == null) updateNull(columnIndex); else updateValues.put(fields[columnIndex - 1].getColumnName(connection), value); }
protected void updateValue(int columnIndex, Object value) throws SQLException { checkUpdateable(); if (!onInsertRow && (isBeforeFirst() || isAfterLast() || rows.size() == 0)) { throw new PSQLException(GT.tr("Cannot update the ResultSet because it is either before the start or after the end of the results."), PSQLState.INVALID_CURSOR_STATE); } checkColumnIndex(columnIndex); doingUpdates = !onInsertRow; if (value == null) { updateNull(columnIndex); } else { PGResultSetMetaData md = (PGResultSetMetaData)getMetaData(); updateValues.put(md.getBaseColumnName(columnIndex), value); } }
public synchronized void updateNull(int columnIndex) throws SQLException { checkColumnIndex(columnIndex); String columnTypeName = connection.getTypeInfo().getPGType(fields[columnIndex - 1].getOID()); updateValue(columnIndex, new NullObject(columnTypeName)); }
public synchronized void updateNull(int columnIndex) throws SQLException { checkColumnIndex(columnIndex); String columnTypeName = connection.getTypeInfo().getPGType(fields[columnIndex - 1].getOID()); updateValue(columnIndex, new NullObject(columnTypeName)); }