Class UpdatableResultSet
- All Implemented Interfaces:
ResultSetInternalMethods, AutoCloseable, ResultSet, Wrapper
- Direct Known Subclasses:
JDBC4UpdatableResultSet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SingleByteCharsetConverterprotected PreparedStatementPreparedStatement used to insert data(package private) static final byte[]Marker for 'stream' data when doing INSERT rowsprotected PreparedStatementPreparedStatement used to delete dataFields inherited from class ResultSetImpl
catalog, columnLabelToIndex, columnNameToIndex, columnToIndexCache, columnUsed, connection, currentRow, doingUpdates, EMPTY_SPACE, fastClientCal, fastDefaultCal, fetchDirection, fetchSize, fields, firstCharOfQuery, fullColumnNameToIndex, gmtCalendar, hasBuiltIndexMapping, isBinaryEncoded, isClosed, MAX_DIFF_PREC, MIN_DIFF_PREC, nextResultSet, onInsertRow, owningStatement, pointOfOrigin, reallyResult, resultCounter, resultId, resultSetConcurrency, resultSetType, retainOwningStatement, rowData, serverInfo, statementUsedForFetchingRows, thisRow, updateCount, updateId, useFastDateParsing, useLegacyDatetimeCode, useUsageAdvisor, warningChain, wasNullFlag, wrapperStatementFields inherited from interface ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUpdatableResultSet(String catalog, Field[] fields, RowData tuples, MySQLConnection conn, StatementImpl creatorStmt) Creates a new ResultSet object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanabsolute(int row) JDBC 2.0voidJDBC 2.0voidJDBC 2.0voidJDBC 2.0 The cancelRowUpdates() method may be called after calling an updateXXX() method(s) and before calling updateRow() to rollback the updates made to a row.protected voidEnsures that the cursor is positioned on a valid row and that the result set is not closedprotected voidIs this ResultSet updateable?voidJDBC 2.0 Delete the current row from the result set and the underlying database.booleanfirst()JDBC 2.0protected voidFigure out whether or not this ResultSet is updateable, and if so, generate the PreparedStatements to support updates.intJDBC 2.0 Return the concurrency of this result set.voidJDBC 2.0 Insert the contents of the insert row into the result set and the database.booleanJDBC 2.0booleanJDBC 2.0booleanisFirst()JDBC 2.0booleanisLast()JDBC 2.0(package private) booleanbooleanlast()JDBC 2.0voidJDBC 2.0 Move the cursor to the remembered cursor position, usually the current row.voidJDBC 2.0 Move to the insert row.booleannext()A ResultSet is initially positioned before its first row, the first call to next makes the first row the current row; the second call makes the second row the current row, etc.booleanprev()The prev method is not part of JDBC, but because of the architecture of this driver it is possible to move both forward and backward within the result set.booleanprevious()JDBC 2.0voidrealClose(boolean calledExplicitly) Closes this ResultSet and releases resources.voidJDBC 2.0 Refresh the value of the current row with its current value in the database.booleanrelative(int rows) JDBC 2.0booleanJDBC 2.0 Determine if this row has been deleted.booleanJDBC 2.0 Determine if the current row has been inserted.booleanJDBC 2.0 Determine if the current row has been updated.protected voidsetResultSetConcurrency(int concurrencyFlag) Sets the concurrency type of this result setprotected voidReset UPDATE prepared statement to value in current row.voidupdateAsciiStream(int columnIndex, InputStream x, int length) JDBC 2.0 Update a column with an ascii stream value.voidupdateAsciiStream(String columnName, InputStream x, int length) JDBC 2.0 Update a column with an ascii stream value.voidupdateBigDecimal(int columnIndex, BigDecimal x) JDBC 2.0 Update a column with a BigDecimal value.voidupdateBigDecimal(String columnName, BigDecimal x) JDBC 2.0 Update a column with a BigDecimal value.voidupdateBinaryStream(int columnIndex, InputStream x, int length) JDBC 2.0 Update a column with a binary stream value.voidupdateBinaryStream(String columnName, InputStream x, int length) JDBC 2.0 Update a column with a binary stream value.voidupdateBlob(int columnIndex, Blob blob) voidupdateBlob(String columnName, Blob blob) voidupdateBoolean(int columnIndex, boolean x) JDBC 2.0 Update a column with a boolean value.voidupdateBoolean(String columnName, boolean x) JDBC 2.0 Update a column with a boolean value.voidupdateByte(int columnIndex, byte x) JDBC 2.0 Update a column with a byte value.voidupdateByte(String columnName, byte x) JDBC 2.0 Update a column with a byte value.voidupdateBytes(int columnIndex, byte[] x) JDBC 2.0 Update a column with a byte array value.voidupdateBytes(String columnName, byte[] x) JDBC 2.0 Update a column with a byte array value.voidupdateCharacterStream(int columnIndex, Reader x, int length) JDBC 2.0 Update a column with a character stream value.voidupdateCharacterStream(String columnName, Reader reader, int length) JDBC 2.0 Update a column with a character stream value.voidupdateClob(int columnIndex, Clob clob) voidupdateDate(int columnIndex, Date x) JDBC 2.0 Update a column with a Date value.voidupdateDate(String columnName, Date x) JDBC 2.0 Update a column with a Date value.voidupdateDouble(int columnIndex, double x) JDBC 2.0 Update a column with a Double value.voidupdateDouble(String columnName, double x) JDBC 2.0 Update a column with a double value.voidupdateFloat(int columnIndex, float x) JDBC 2.0 Update a column with a float value.voidupdateFloat(String columnName, float x) JDBC 2.0 Update a column with a float value.voidupdateInt(int columnIndex, int x) JDBC 2.0 Update a column with an integer value.voidJDBC 2.0 Update a column with an integer value.voidupdateLong(int columnIndex, long x) JDBC 2.0 Update a column with a long value.voidupdateLong(String columnName, long x) JDBC 2.0 Update a column with a long value.voidupdateNull(int columnIndex) JDBC 2.0 Give a nullable column a null value.voidupdateNull(String columnName) JDBC 2.0 Update a column with a null value.voidupdateObject(int columnIndex, Object x) JDBC 2.0 Update a column with an Object value.voidupdateObject(int columnIndex, Object x, int scale) JDBC 2.0 Update a column with an Object value.voidupdateObject(String columnName, Object x) JDBC 2.0 Update a column with an Object value.voidupdateObject(String columnName, Object x, int scale) JDBC 2.0 Update a column with an Object value.protected voidupdateObjectInternal(int columnIndex, Object x, Integer targetType, int scaleOrLength) Internal setObject implementation.voidJDBC 2.0 Update the underlying database with the new contents of the current row.voidupdateShort(int columnIndex, short x) JDBC 2.0 Update a column with a short value.voidupdateShort(String columnName, short x) JDBC 2.0 Update a column with a short value.voidupdateString(int columnIndex, String x) JDBC 2.0 Update a column with a String value.voidupdateString(String columnName, String x) JDBC 2.0 Update a column with a String value.voidupdateTime(int columnIndex, Time x) JDBC 2.0 Update a column with a Time value.voidupdateTime(String columnName, Time x) JDBC 2.0 Update a column with a Time value.voidupdateTimestamp(int columnIndex, Timestamp x) JDBC 2.0 Update a column with a Timestamp value.voidupdateTimestamp(String columnName, Timestamp x) JDBC 2.0 Update a column with a Timestamp value.Methods inherited from class ResultSetImpl
arraysEqual, buildIndexMapping, checkClosed, checkColumnBounds, clearNextResult, clearWarnings, close, convertLongToUlong, copy, fastDateCreate, fastTimeCreate, fastTimestampCreate, findColumn, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getBytes, getBytesSize, getCalendarInstanceForSessionOrNew, getCharacterStream, getCharacterStream, getClob, getClob, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getDoubleInternal, getDoubleInternal, getExceptionInterceptor, getFetchDirection, getFetchSize, getFirstCharOfQuery, getFloat, getFloat, getGmtCalendar, getId, getInstance, getInstance, getInt, getInt, getLong, getLong, getMetaData, getNativeArray, getNativeAsciiStream, getNativeBigDecimal, getNativeBigDecimal, getNativeBinaryStream, getNativeBlob, getNativeByte, getNativeByte, getNativeBytes, getNativeCharacterStream, getNativeClob, getNativeDate, getNativeDate, getNativeDateViaParseConversion, getNativeDouble, getNativeFloat, getNativeInt, getNativeInt, getNativeLong, getNativeLong, getNativeRef, getNativeShort, getNativeShort, getNativeString, getNativeTimestampViaParseConversion, getNativeTimeViaParseConversion, getNativeUnicodeStream, getNativeURL, getNextResultSet, getObject, getObject, getObject, getObject, getObject, getObject, getObjectStoredProc, getObjectStoredProc, getObjectStoredProc, getObjectStoredProc, getRef, getRef, getRow, getServerInfo, getShort, getShort, getStatement, getString, getString, getStringInternal, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getUpdateCount, getUpdateID, getURL, getURL, getWarnings, initializeFromCachedMetaData, initializeWithMetadata, isClosed, populateCachedMetaData, reallyResult, redefineFieldsForDBMD, setBinaryEncoded, setFetchDirection, setFetchSize, setFirstCharOfQuery, setNextResultSet, setOwningStatement, setResultSetType, setServerInfo, setStatementUsedForFetchingRows, setWrapperStatement, toString, updateArray, updateArray, updateClob, updateRef, updateRef, wasNullMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ResultSet
getHoldability, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getRowId, getRowId, getSQLXML, getSQLXML, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateObject, updateObject, updateObject, updateObject, updateRowId, updateRowId, updateSQLXML, updateSQLXMLMethods inherited from interface Wrapper
isWrapperFor, unwrap
-
Field Details
-
STREAM_DATA_MARKER
static final byte[] STREAM_DATA_MARKERMarker for 'stream' data when doing INSERT rows -
charConverter
-
inserter
PreparedStatement used to insert data -
updater
PreparedStatement used to delete data
-
-
Constructor Details
-
UpdatableResultSet
protected UpdatableResultSet(String catalog, Field[] fields, RowData tuples, MySQLConnection conn, StatementImpl creatorStmt) throws SQLException Creates a new ResultSet object.- Parameters:
catalog- the database in use when we were createdfields- an array of Field objects (basically, the ResultSet MetaData)tuples- actual row dataconn- the Connection that created us.creatorStmt-- Throws:
SQLException
-
-
Method Details
-
absolute
JDBC 2.0Move to an absolute row number in the result set.
If row is positive, moves to an absolute row with respect to the beginning of the result set. The first row is row 1, the second is row 2, etc.
If row is negative, moves to an absolute row position with respect to the end of result set. For example, calling absolute(-1) positions the cursor on the last row, absolute(-2) indicates the next-to-last row, etc.
An attempt to position the cursor beyond the first/last row in the result set, leaves the cursor before/after the first/last row, respectively.
Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().
- Specified by:
absolutein interfaceResultSet- Overrides:
absolutein classResultSetImpl- Parameters:
row-- Returns:
- true if on the result set, false if off.
- Throws:
SQLException- if a database-access error occurs, or row is 0, or result set type is TYPE_FORWARD_ONLY.
-
afterLast
JDBC 2.0Moves to the end of the result set, just after the last row. Has no effect if the result set contains no rows.
- Specified by:
afterLastin interfaceResultSet- Overrides:
afterLastin classResultSetImpl- Throws:
SQLException- if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY.
-
beforeFirst
JDBC 2.0Moves to the front of the result set, just before the first row. Has no effect if the result set contains no rows.
- Specified by:
beforeFirstin interfaceResultSet- Overrides:
beforeFirstin classResultSetImpl- Throws:
SQLException- if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY
-
cancelRowUpdates
JDBC 2.0 The cancelRowUpdates() method may be called after calling an updateXXX() method(s) and before calling updateRow() to rollback the updates made to a row. If no updates have been made or updateRow() has already been called, then this method has no effect.- Specified by:
cancelRowUpdatesin interfaceResultSet- Overrides:
cancelRowUpdatesin classResultSetImpl- Throws:
SQLException- if a database-access error occurs, or if called when on the insert row.
-
checkRowPos
Description copied from class:ResultSetImplEnsures that the cursor is positioned on a valid row and that the result set is not closed- Overrides:
checkRowPosin classResultSetImpl- Throws:
SQLException- if the result set is not in a valid state for traversal
-
checkUpdatability
Is this ResultSet updateable?- Throws:
SQLException
-
deleteRow
JDBC 2.0 Delete the current row from the result set and the underlying database. Cannot be called when on the insert row.- Specified by:
deleteRowin interfaceResultSet- Overrides:
deleteRowin classResultSetImpl- Throws:
SQLException- if a database-access error occurs, or if called when on the insert row.SQLException- if the ResultSet is not updatable or some other error occurs
-
first
JDBC 2.0Moves to the first row in the result set.
- Specified by:
firstin interfaceResultSet- Overrides:
firstin classResultSetImpl- Returns:
- true if on a valid row, false if no rows in the result set.
- Throws:
SQLException- if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY.
-
generateStatements
Figure out whether or not this ResultSet is updateable, and if so, generate the PreparedStatements to support updates.- Throws:
SQLExceptionNotUpdatable
-
getConcurrency
JDBC 2.0 Return the concurrency of this result set. The concurrency used is determined by the statement that created the result set.- Specified by:
getConcurrencyin interfaceResultSet- Overrides:
getConcurrencyin classResultSetImpl- Returns:
- the concurrency type, CONCUR_READ_ONLY, etc.
- Throws:
SQLException- if a database-access error occurs
-
insertRow
JDBC 2.0 Insert the contents of the insert row into the result set and the database. Must be on the insert row when this method is called.- Specified by:
insertRowin interfaceResultSet- Overrides:
insertRowin classResultSetImpl- Throws:
SQLException- if a database-access error occurs, if called when not on the insert row, or if all non-nullable columns in the insert row have not been given a value
-
isAfterLast
JDBC 2.0Determine if the cursor is after the last row in the result set.
- Specified by:
isAfterLastin interfaceResultSet- Overrides:
isAfterLastin classResultSetImpl- Returns:
- true if after the last row, false otherwise. Returns false when the result set contains no rows.
- Throws:
SQLException- if a database-access error occurs.
-
isBeforeFirst
JDBC 2.0Determine if the cursor is before the first row in the result set.
- Specified by:
isBeforeFirstin interfaceResultSet- Overrides:
isBeforeFirstin classResultSetImpl- Returns:
- true if before the first row, false otherwise. Returns false when the result set contains no rows.
- Throws:
SQLException- if a database-access error occurs.
-
isFirst
JDBC 2.0Determine if the cursor is on the first row of the result set.
- Specified by:
isFirstin interfaceResultSet- Overrides:
isFirstin classResultSetImpl- Returns:
- true if on the first row, false otherwise.
- Throws:
SQLException- if a database-access error occurs.
-
isLast
JDBC 2.0Determine if the cursor is on the last row of the result set. Note: Calling isLast() may be expensive since the JDBC driver might need to fetch ahead one row in order to determine whether the current row is the last row in the result set.
- Specified by:
isLastin interfaceResultSet- Overrides:
isLastin classResultSetImpl- Returns:
- true if on the last row, false otherwise.
- Throws:
SQLException- if a database-access error occurs.
-
isUpdatable
boolean isUpdatable() -
last
JDBC 2.0Moves to the last row in the result set.
- Specified by:
lastin interfaceResultSet- Overrides:
lastin classResultSetImpl- Returns:
- true if on a valid row, false if no rows in the result set.
- Throws:
SQLException- if a database-access error occurs, or result set type is TYPE_FORWARD_ONLY.
-
moveToCurrentRow
JDBC 2.0 Move the cursor to the remembered cursor position, usually the current row. Has no effect unless the cursor is on the insert row.- Specified by:
moveToCurrentRowin interfaceResultSet- Overrides:
moveToCurrentRowin classResultSetImpl- Throws:
SQLException- if a database-access error occurs, or the result set is not updatableSQLException- if the ResultSet is not updatable or some other error occurs
-
moveToInsertRow
JDBC 2.0 Move to the insert row. The current cursor position is remembered while the cursor is positioned on the insert row. The insert row is a special row associated with an updatable result set. It is essentially a buffer where a new row may be constructed by calling the updateXXX() methods prior to inserting the row into the result set. Only the updateXXX(), getXXX(), and insertRow() methods may be called when the cursor is on the insert row. All of the columns in a result set must be given a value each time this method is called before calling insertRow(). UpdateXXX()must be called before getXXX() on a column.- Specified by:
moveToInsertRowin interfaceResultSet- Overrides:
moveToInsertRowin classResultSetImpl- Throws:
SQLException- if a database-access error occurs, or the result set is not updatableNotUpdatable
-
next
A ResultSet is initially positioned before its first row, the first call to next makes the first row the current row; the second call makes the second row the current row, etc.If an input stream from the previous row is open, it is implicitly closed. The ResultSet's warning chain is cleared when a new row is read
- Specified by:
nextin interfaceResultSet- Overrides:
nextin classResultSetImpl- Returns:
- true if the new current is valid; false if there are no more rows
- Throws:
SQLException- if a database access error occurs
-
prev
The prev method is not part of JDBC, but because of the architecture of this driver it is possible to move both forward and backward within the result set.If an input stream from the previous row is open, it is implicitly closed. The ResultSet's warning chain is cleared when a new row is read
- Overrides:
previn classResultSetImpl- Returns:
- true if the new current is valid; false if there are no more rows
- Throws:
SQLException- if a database access error occurs
-
previous
JDBC 2.0Moves to the previous row in the result set.
Note: previous() is not the same as relative(-1) since it makes sense to call previous() when there is no current row.
- Specified by:
previousin interfaceResultSet- Overrides:
previousin classResultSetImpl- Returns:
- true if on a valid row, false if off the result set.
- Throws:
SQLException- if a database-access error occurs, or result set type is TYPE_FORWAR_DONLY.
-
realClose
Closes this ResultSet and releases resources.- Specified by:
realClosein interfaceResultSetInternalMethods- Overrides:
realClosein classResultSetImpl- Parameters:
calledExplicitly- was realClose called by the standard ResultSet.close() method, or was it closed internally by the driver?- Throws:
SQLException- if an error occurs.
-
refreshRow
JDBC 2.0 Refresh the value of the current row with its current value in the database. Cannot be called when on the insert row. The refreshRow() method provides a way for an application to explicitly tell the JDBC driver to refetch a row(s) from the database. An application may want to call refreshRow() when caching or prefetching is being done by the JDBC driver to fetch the latest value of a row from the database. The JDBC driver may actually refresh multiple rows at once if the fetch size is greater than one. All values are refetched subject to the transaction isolation level and cursor sensitivity. If refreshRow() is called after calling updateXXX(), but before calling updateRow() then the updates made to the row are lost. Calling refreshRow() frequently will likely slow performance.- Specified by:
refreshRowin interfaceResultSet- Overrides:
refreshRowin classResultSetImpl- Throws:
SQLException- if a database-access error occurs, or if called when on the insert row.NotUpdatable
-
relative
JDBC 2.0Moves a relative number of rows, either positive or negative. Attempting to move beyond the first/last row in the result set positions the cursor before/after the the first/last row. Calling relative(0) is valid, but does not change the cursor position.
Note: Calling relative(1) is different than calling next() since is makes sense to call next() when there is no current row, for example, when the cursor is positioned before the first row or after the last row of the result set.
- Specified by:
relativein interfaceResultSet- Overrides:
relativein classResultSetImpl- Parameters:
rows-- Returns:
- true if on a row, false otherwise.
- Throws:
SQLException- if a database-access error occurs, or there is no current row, or result set type is TYPE_FORWARD_ONLY.
-
rowDeleted
JDBC 2.0 Determine if this row has been deleted. A deleted row may leave a visible "hole" in a result set. This method can be used to detect holes in a result set. The value returned depends on whether or not the result set can detect deletions.- Specified by:
rowDeletedin interfaceResultSet- Overrides:
rowDeletedin classResultSetImpl- Returns:
- true if deleted and deletes are detected
- Throws:
SQLException- if a database-access error occursNotImplemented- See Also:
-
rowInserted
JDBC 2.0 Determine if the current row has been inserted. The value returned depends on whether or not the result set can detect visible inserts.- Specified by:
rowInsertedin interfaceResultSet- Overrides:
rowInsertedin classResultSetImpl- Returns:
- true if inserted and inserts are detected
- Throws:
SQLException- if a database-access error occursNotImplemented- See Also:
-
rowUpdated
JDBC 2.0 Determine if the current row has been updated. The value returned depends on whether or not the result set can detect updates.- Specified by:
rowUpdatedin interfaceResultSet- Overrides:
rowUpdatedin classResultSetImpl- Returns:
- true if the row has been visibly updated by the owner or another, and updates are detected
- Throws:
SQLException- if a database-access error occursNotImplemented- See Also:
-
setResultSetConcurrency
protected void setResultSetConcurrency(int concurrencyFlag) Sets the concurrency type of this result set- Overrides:
setResultSetConcurrencyin classResultSetImpl- Parameters:
concurrencyFlag- the type of concurrency that this ResultSet should support.
-
syncUpdate
Reset UPDATE prepared statement to value in current row. This_Row MUST point to current, valid row.- Throws:
SQLException
-
updateAsciiStream
JDBC 2.0 Update a column with an ascii stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateAsciiStreamin interfaceResultSet- Overrides:
updateAsciiStreamin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column valuelength- the length of the stream- Throws:
SQLException- if a database-access error occurs
-
updateAsciiStream
JDBC 2.0 Update a column with an ascii stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateAsciiStreamin interfaceResultSet- Overrides:
updateAsciiStreamin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column valuelength- of the stream- Throws:
SQLException- if a database-access error occurs
-
updateBigDecimal
JDBC 2.0 Update a column with a BigDecimal value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateBigDecimalin interfaceResultSet- Overrides:
updateBigDecimalin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateBigDecimal
JDBC 2.0 Update a column with a BigDecimal value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateBigDecimalin interfaceResultSet- Overrides:
updateBigDecimalin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateBinaryStream
JDBC 2.0 Update a column with a binary stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateBinaryStreamin interfaceResultSet- Overrides:
updateBinaryStreamin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column valuelength- the length of the stream- Throws:
SQLException- if a database-access error occurs
-
updateBinaryStream
JDBC 2.0 Update a column with a binary stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateBinaryStreamin interfaceResultSet- Overrides:
updateBinaryStreamin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column valuelength- of the stream- Throws:
SQLException- if a database-access error occurs
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Overrides:
updateBlobin classResultSetImpl- Throws:
SQLException- See Also:
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Overrides:
updateBlobin classResultSetImpl- Throws:
SQLException- See Also:
-
updateBoolean
JDBC 2.0 Update a column with a boolean value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateBooleanin interfaceResultSet- Overrides:
updateBooleanin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateBoolean
JDBC 2.0 Update a column with a boolean value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateBooleanin interfaceResultSet- Overrides:
updateBooleanin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateByte
JDBC 2.0 Update a column with a byte value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateBytein interfaceResultSet- Overrides:
updateBytein classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateByte
JDBC 2.0 Update a column with a byte value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateBytein interfaceResultSet- Overrides:
updateBytein classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateBytes
JDBC 2.0 Update a column with a byte array value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateBytesin interfaceResultSet- Overrides:
updateBytesin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateBytes
JDBC 2.0 Update a column with a byte array value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateBytesin interfaceResultSet- Overrides:
updateBytesin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateCharacterStream
JDBC 2.0 Update a column with a character stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateCharacterStreamin interfaceResultSet- Overrides:
updateCharacterStreamin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column valuelength- the length of the stream- Throws:
SQLException- if a database-access error occurs
-
updateCharacterStream
JDBC 2.0 Update a column with a character stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateCharacterStreamin interfaceResultSet- Overrides:
updateCharacterStreamin classResultSetImpl- Parameters:
columnName- the name of the columnreader- the new column valuelength- of the stream- Throws:
SQLException- if a database-access error occurs
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Overrides:
updateClobin classResultSetImpl- Throws:
SQLException- See Also:
-
updateDate
JDBC 2.0 Update a column with a Date value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateDatein interfaceResultSet- Overrides:
updateDatein classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateDate
JDBC 2.0 Update a column with a Date value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateDatein interfaceResultSet- Overrides:
updateDatein classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateDouble
JDBC 2.0 Update a column with a Double value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateDoublein interfaceResultSet- Overrides:
updateDoublein classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateDouble
JDBC 2.0 Update a column with a double value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateDoublein interfaceResultSet- Overrides:
updateDoublein classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateFloat
JDBC 2.0 Update a column with a float value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateFloatin interfaceResultSet- Overrides:
updateFloatin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateFloat
JDBC 2.0 Update a column with a float value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateFloatin interfaceResultSet- Overrides:
updateFloatin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateInt
JDBC 2.0 Update a column with an integer value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateIntin interfaceResultSet- Overrides:
updateIntin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateInt
JDBC 2.0 Update a column with an integer value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateIntin interfaceResultSet- Overrides:
updateIntin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateLong
JDBC 2.0 Update a column with a long value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateLongin interfaceResultSet- Overrides:
updateLongin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateLong
JDBC 2.0 Update a column with a long value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateLongin interfaceResultSet- Overrides:
updateLongin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateNull
JDBC 2.0 Give a nullable column a null value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateNullin interfaceResultSet- Overrides:
updateNullin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...- Throws:
SQLException- if a database-access error occurs
-
updateNull
JDBC 2.0 Update a column with a null value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateNullin interfaceResultSet- Overrides:
updateNullin classResultSetImpl- Parameters:
columnName- the name of the column- Throws:
SQLException- if a database-access error occurs
-
updateObject
JDBC 2.0 Update a column with an Object value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateObject
JDBC 2.0 Update a column with an Object value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column valuescale- For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types this is the number of digits after the decimal. For all other types this value will be ignored.- Throws:
SQLException- if a database-access error occurs
-
updateObjectInternal
protected void updateObjectInternal(int columnIndex, Object x, Integer targetType, int scaleOrLength) throws SQLException Internal setObject implementation. Although targetType is not part of default ResultSet methods signatures, it is used for type conversions from JDBC42UpdatableResultSet new JDBC 4.2 updateObject() methods.- Parameters:
columnIndex-x-targetType-scaleOrLength-- Throws:
SQLException
-
updateObject
JDBC 2.0 Update a column with an Object value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateObject
JDBC 2.0 Update a column with an Object value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column valuescale- For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types this is the number of digits after the decimal. For all other types this value will be ignored.- Throws:
SQLException- if a database-access error occurs
-
updateRow
JDBC 2.0 Update the underlying database with the new contents of the current row. Cannot be called when on the insert row.- Specified by:
updateRowin interfaceResultSet- Overrides:
updateRowin classResultSetImpl- Throws:
SQLException- if a database-access error occurs, or if called when on the insert rowNotUpdatable
-
updateShort
JDBC 2.0 Update a column with a short value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateShortin interfaceResultSet- Overrides:
updateShortin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateShort
JDBC 2.0 Update a column with a short value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateShortin interfaceResultSet- Overrides:
updateShortin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateString
JDBC 2.0 Update a column with a String value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateStringin interfaceResultSet- Overrides:
updateStringin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateString
JDBC 2.0 Update a column with a String value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateStringin interfaceResultSet- Overrides:
updateStringin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateTime
JDBC 2.0 Update a column with a Time value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateTimein interfaceResultSet- Overrides:
updateTimein classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateTime
JDBC 2.0 Update a column with a Time value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateTimein interfaceResultSet- Overrides:
updateTimein classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateTimestamp
JDBC 2.0 Update a column with a Timestamp value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateTimestampin interfaceResultSet- Overrides:
updateTimestampin classResultSetImpl- Parameters:
columnIndex- the first column is 1, the second is 2, ...x- the new column value- Throws:
SQLException- if a database-access error occurs
-
updateTimestamp
JDBC 2.0 Update a column with a Timestamp value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.- Specified by:
updateTimestampin interfaceResultSet- Overrides:
updateTimestampin classResultSetImpl- Parameters:
columnName- the name of the columnx- the new column value- Throws:
SQLException- if a database-access error occurs
-