public synchronized void updateNull(String columnName) throws SQLException { updateNull(findColumn(columnName)); }
public synchronized void updateCharacterStream(int columnIndex, java.io.Reader x, int length) throws SQLException { if (x == null) { updateNull(columnIndex); return; } try { char[] data = new char[length]; int numRead = 0; while (true) { int n = x.read(data, numRead, length - numRead); if (n == -1) { break; } numRead += n; if (numRead == length) { break; } } updateString(columnIndex, new String(data, 0, numRead)); } catch (IOException ie) { throw new PSQLException(GT.tr("Provided Reader failed."), null, ie); } }
public synchronized void updateAsciiStream(int columnIndex, java.io.InputStream x, int length) throws SQLException { if (x == null) { updateNull(columnIndex); return; } try { InputStreamReader reader = new InputStreamReader(x, "ASCII"); char[] data = new char[length]; int numRead = 0; while (true) { int n = reader.read(data, numRead, length - numRead); if (n == -1) { break; } numRead += n; if (numRead == length) { break; } } updateString(columnIndex, new String(data, 0, numRead)); } catch (UnsupportedEncodingException uee) { throw new PSQLException(GT.tr("The JVM claims not to support the encoding: {0}", "ASCII"), PSQLState.UNEXPECTED_ERROR, uee); } catch (IOException ie) { throw new PSQLException(GT.tr("Provided InputStream failed."), null, ie); } }
public synchronized void updateBinaryStream(int columnIndex, java.io.InputStream x, int length) throws SQLException { if (x == null) { updateNull(columnIndex); return;
protected void updateValue(int columnIndex, Object value) throws SQLException { checkUpdateable(); if (!onInsertRow && (isBeforeFirst() || isAfterLast() || rows.isEmpty())) { 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); } }