Most visited

Recently visited

Added in API level 1

ResultSet

public interface ResultSet
implements Wrapper, AutoCloseable

java.sql.ResultSet
Known Indirect Subclasses


表示数据库结果集的数据表,通常通过执行查询数据库的语句生成。

一个ResultSet对象维护一个指向其当前数据行的游标。 最初光标位于第一行之前。 next方法将光标移动到下一行,并且因为它在ResultSet对象中没有更多行时返回false ,所以它可以在while循环中用于遍历结果集。

默认的ResultSet对象不可更新,并且只有一个只能向前移动的游标。 因此,只能从第一行到最后一行迭代遍历它。 这是可能产生ResultSet对象是可滚动和/或可更新的。 以下代码片段(其中con是有效的Connection对象)说明了如何创建一个可滚动且对其他人的更新不敏感的结果集,并且这是可更新的。 有关其他选项,请参阅ResultSet字段。


       Statement stmt = con.createStatement(
                                      ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
       ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
       // rs will be scrollable, will not show changes made by others,
       // and will be updatable

 
The ResultSet interface provides getter methods ( getBoolean, getLong, and so on) for retrieving column values from the current row. Values can be retrieved using either the index number of the column or the name of the column. In general, using the column index will be more efficient. Columns are numbered from 1. For maximum portability, result set columns within each row should be read in left-to-right order, and each column should be read only once.

对于getter方法,JDBC驱动程序会尝试将基础数据转换为getter方法中指定的Java类型,并返回适当的Java值。 JDBC规范具有一个表,显示可从ResultSet getter方法使用的SQL类型到Java类型的允许映射。

用作getter方法输入的列名不区分大小写。 当使用列名称调用getter方法并且多个列具有相同的名称时,将返回第一个匹配列的值。 列名选项设计为在生成结果集的SQL查询中使用列名时使用。 对于在查询中未明确命名的列,最好使用列号。 如果使用列名称,程序员应小心保证它们唯一地引用预期的列,这可以通过SQL AS子句来保证。

在JDBC 2.0 API(Java TM 2 SDK,标准版,1.2)中的此接口中添加了一组更新方法。 有关getter方法参数的注释也适用于更新器方法的参数。

更新器方法可以以两种方式使用:

  1. to update a column value in the current row. In a scrollable ResultSet object, the cursor can be moved backwards and forwards, to an absolute position, or to a position relative to the current row. The following code fragment updates the NAME column in the fifth row of the ResultSet object rs and then uses the method updateRow to update the data source table from which rs was derived.
    
           rs.absolute(5); // moves the cursor to the fifth row of rs
           rs.updateString("NAME", "AINSWORTH"); // updates the
              // NAME column of row 5 to be AINSWORTH
           rs.updateRow(); // updates the row in the data source
    
     
  2. to insert column values into the insert row. An updatable ResultSet object has a special row associated with it that serves as a staging area for building a row to be inserted. The following code fragment moves the cursor to the insert row, builds a three-column row, and inserts it into rs and into the data source table using the method insertRow.
    
           rs.moveToInsertRow(); // moves cursor to the insert row
           rs.updateString(1, "AINSWORTH"); // updates the
              // first column of the insert row to be AINSWORTH
           rs.updateInt(2,35); // updates the second column to be 35
           rs.updateBoolean(3, true); // updates the third column to true
           rs.insertRow();
           rs.moveToCurrentRow();
    
     

当生成它的 Statement对象被关闭,重新执行或用于从多个结果序列中检索下一个结果时, ResultSet对象会自动关闭。

ResultSet对象列的数量,类型和属性由 ResultSet.getMetaData方法返回的 ResultSetMetaData对象提供。

也可以看看:

Summary

Constants

int CLOSE_CURSORS_AT_COMMIT

ResultSet当前事务时,指示具有此可保存性的开放 ResultSet对象的常量将被关闭。

int CONCUR_READ_ONLY

该常数指示可能无法更新的 ResultSet对象的并发模式。

int CONCUR_UPDATABLE

该常数指示可能更新的 ResultSet对象的并发模式。

int FETCH_FORWARD

该常数表示结果集中的行将以正向处理; 第一个到最后。

int FETCH_REVERSE

该常数表示结果集中的行将反向处理; 最后到第一位。

int FETCH_UNKNOWN

该常量指示结果集中行的处理顺序未知。

int HOLD_CURSORS_OVER_COMMIT

ResultSet当前事务时,表示具有此可保存性的开放 ResultSet对象将保持打开。

int TYPE_FORWARD_ONLY

该常数表示光标可能只能向前移动的 ResultSet对象的类型。

int TYPE_SCROLL_INSENSITIVE

该常数指示可滚动的 ResultSet对象的类型,但通常对 ResultSet的数据更改不敏感。

int TYPE_SCROLL_SENSITIVE

该常数指示可滚动的 ResultSet对象的类型,并且通常对 ResultSet的数据更改敏感。

Public methods

abstract boolean absolute(int row)

将光标移动到此 ResultSet对象中的给定行号。

abstract void afterLast()

将光标移动到最后一行后面的 ResultSet对象的末尾。

abstract void beforeFirst()

将光标移动到该前方 ResultSet正好位于第一行之前的对象。

abstract void cancelRowUpdates()

取消对此 ResultSet对象中的当前行进行的更新。

abstract void clearWarnings()

清除此 ResultSet对象上报告的所有警告。

abstract void close()

释放此 ResultSet对象的数据库和JDBC资源,而不是等待时,自动关闭这种情况发生。

abstract void deleteRow()

从此 ResultSet对象和底层数据库中删除当前行。

abstract int findColumn(String columnLabel)

将给定的 ResultSet列标签映射到其 ResultSet列索引。

abstract boolean first()

将光标移动到此 ResultSet对象中的第一行。

abstract Array getArray(int columnIndex)

以Java编程语言中的 ResultSet对象的形式 ArrayResultSet对象的当前行中指定列的值。

abstract Array getArray(String columnLabel)

以Java编程语言中的 ResultSet对象的形式 ArrayResultSet对象的当前行中指定列的值。

abstract InputStream getAsciiStream(int columnIndex)

ResultSet对象的当前行作为ASCII字符流检索指定列的值。

abstract InputStream getAsciiStream(String columnLabel)

ResultSet对象的当前行作为ASCII字符流检索指定列的值。

abstract BigDecimal getBigDecimal(String columnLabel)

java.math.BigDecimal的全部精度检索此 ResultSet对象当前行中指定列的值。

abstract BigDecimal getBigDecimal(String columnLabel, int scale)

此方法在API级别1中已弃用。已弃用

abstract BigDecimal getBigDecimal(int columnIndex, int scale)

此方法在API级别1中已弃用。已弃用

abstract BigDecimal getBigDecimal(int columnIndex)

java.math.BigDecimal的全部精度检索此 ResultSet对象当前行中指定列的值。

abstract InputStream getBinaryStream(String columnLabel)

以未解释的 byte s的流的形式 byteResultSet对象当前行中指定列的值。

abstract InputStream getBinaryStream(int columnIndex)

以未解释的字节流的形式检索此 ResultSet对象当前行中指定列的值。

abstract Blob getBlob(int columnIndex)

以Java编程语言中的 ResultSet对象的形式 BlobResultSet对象当前行中指定列的值。

abstract Blob getBlob(String columnLabel)

以Java编程语言中的 ResultSet对象的形式 BlobResultSet对象当前行中指定列的值。

abstract boolean getBoolean(String columnLabel)

以Java编程语言中的 booleanResultSet对象的当前行中指定列的值。

abstract boolean getBoolean(int columnIndex)

以Java编程语言中的 booleanResultSet对象当前行中指定列的值。

abstract byte getByte(String columnLabel)

以Java编程语言中的 byteResultSet对象的当前行中指定列的值。

abstract byte getByte(int columnIndex)

以Java编程语言中的 byteResultSet对象当前行中指定列的值。

abstract byte[] getBytes(String columnLabel)

以Java编程语言中的 byte数组检索此 ResultSet对象当前行中指定列的值。

abstract byte[] getBytes(int columnIndex)

以Java编程语言中的 byte数组检索此 ResultSet对象当前行中指定列的值。

abstract Reader getCharacterStream(int columnIndex)

ResultSet对象的形式 java.io.ReaderResultSet对象当前行中指定列的值。

abstract Reader getCharacterStream(String columnLabel)

ResultSet对象的形式 java.io.ReaderResultSet对象当前行中指定列的值。

abstract Clob getClob(int columnIndex)

以Java编程语言中的 ResultSet对象的形式 ClobResultSet对象的当前行中指定列的值。

abstract Clob getClob(String columnLabel)

以Java编程语言中的 ResultSet对象的形式 ClobResultSet对象当前行中指定列的值。

abstract int getConcurrency()

检索此 ResultSet对象的并发模式。

abstract String getCursorName()

检索此 ResultSet对象使用的SQL游标的名称。

abstract Date getDate(int columnIndex)

以Java编程语言中的 ResultSet对象的形式 java.sql.DateResultSet对象的当前行中指定列的值。

abstract Date getDate(String columnLabel)

以Java编程语言中的 ResultSet对象的形式 java.sql.DateResultSet对象当前行中指定列的值。

abstract Date getDate(String columnLabel, Calendar cal)

以Java编程语言中的 ResultSet对象的形式 java.sql.DateResultSet对象当前行中指定列的值。

abstract Date getDate(int columnIndex, Calendar cal)

以Java编程语言中的 ResultSet对象的形式 java.sql.DateResultSet对象当前行中指定列的值。

abstract double getDouble(int columnIndex)

以Java编程语言中的 doubleResultSet对象当前行中指定列的值。

abstract double getDouble(String columnLabel)

以Java编程语言中的 doubleResultSet对象当前行中指定列的值。

abstract int getFetchDirection()

检索此 ResultSet对象的获取方向。

abstract int getFetchSize()

检索此 ResultSet对象的获取大小。

abstract float getFloat(String columnLabel)

以Java编程语言中的 floatResultSet对象当前行中指定列的值。

abstract float getFloat(int columnIndex)

以Java编程语言中的 floatResultSet对象的当前行中指定列的值。

abstract int getHoldability()

检索此 ResultSet对象的可保存性

abstract int getInt(int columnIndex)

以Java编程语言中的 intResultSet对象的当前行中指定列的值。

abstract int getInt(String columnLabel)

以Java编程语言中的 intResultSet对象当前行中指定列的值。

abstract long getLong(String columnLabel)

以Java编程语言中的 longResultSet对象的当前行中指定列的值。

abstract long getLong(int columnIndex)

以Java编程语言中的 longResultSet对象当前行中指定列的值。

abstract ResultSetMetaData getMetaData()

检索此 ResultSet对象列的数量,类型和属性。

abstract Reader getNCharacterStream(int columnIndex)

ResultSet对象的形式 java.io.ReaderResultSet对象当前行中指定列的值。

abstract Reader getNCharacterStream(String columnLabel)

ResultSet对象的形式 java.io.ReaderResultSet对象当前行中指定列的值。

abstract NClob getNClob(String columnLabel)

以Java编程语言中的 ResultSet对象的形式 NClobResultSet对象的当前行中指定列的值。

abstract NClob getNClob(int columnIndex)

以Java编程语言中的 ResultSet对象的形式 NClobResultSet对象的当前行中指定列的值。

abstract String getNString(String columnLabel)

以Java编程语言中的 StringResultSet对象当前行中指定列的值。

abstract String getNString(int columnIndex)

以Java编程语言中的 StringResultSet对象的当前行中指定列的值。

abstract Object getObject(int columnIndex)

以Java编程语言中的 Object获取此 ResultSet对象当前行中指定列的值。

abstract Object getObject(String columnLabel)

以Java编程语言中的 Object获取此 ResultSet对象当前行中指定列的值。

abstract Object getObject(int columnIndex, Map<StringClass<?>> map)

以Java编程语言中的 ObjectResultSet对象的当前行中指定列的值。

abstract Object getObject(String columnLabel, Map<StringClass<?>> map)

以Java编程语言中的 ObjectResultSet对象当前行中指定列的值。

abstract Ref getRef(int columnIndex)

以Java编程语言中的 ResultSet对象的形式 RefResultSet对象的当前行中指定列的值。

abstract Ref getRef(String columnLabel)

以Java编程语言中的 ResultSet对象的形式 RefResultSet对象的当前行中指定列的值。

abstract int getRow()

检索当前行号。

abstract RowId getRowId(int columnIndex)

以Java编程语言中的 ResultSet对象的形式 java.sql.RowIdResultSet对象的当前行中指定列的值。

abstract RowId getRowId(String columnLabel)

以Java编程语言中的 ResultSet对象的形式 java.sql.RowIdResultSet对象当前行中指定列的值。

abstract SQLXML getSQLXML(String columnLabel)

以Java编程语言中的 java.sql.SQLXML对象的形式获取此 ResultSet的当前行中指定列的值。

abstract SQLXML getSQLXML(int columnIndex)

以Java编程语言中的 java.sql.SQLXML对象的形式获取此 ResultSet的当前行中指定列的值。

abstract short getShort(String columnLabel)

以Java编程语言中的 shortResultSet对象当前行中指定列的值。

abstract short getShort(int columnIndex)

以Java编程语言中的 shortResultSet对象当前行中指定列的值。

abstract Statement getStatement()

检索 Statement生成此对象 ResultSet对象。

abstract String getString(int columnIndex)

以Java编程语言中的 StringResultSet对象当前行中指定列的值。

abstract String getString(String columnLabel)

以Java编程语言中的 StringResultSet对象当前行中指定列的值。

abstract Time getTime(String columnLabel)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimeResultSet对象当前行中指定列的值。

abstract Time getTime(String columnLabel, Calendar cal)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimeResultSet对象当前行中指定列的值。

abstract Time getTime(int columnIndex)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimeResultSet对象当前行中指定列的值。

abstract Time getTime(int columnIndex, Calendar cal)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimeResultSet对象当前行中指定列的值。

abstract Timestamp getTimestamp(int columnIndex, Calendar cal)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimestampResultSet对象当前行中指定列的值。

abstract Timestamp getTimestamp(int columnIndex)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimestampResultSet对象的当前行中指定列的值。

abstract Timestamp getTimestamp(String columnLabel, Calendar cal)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimestampResultSet对象当前行中指定列的值。

abstract Timestamp getTimestamp(String columnLabel)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimestampResultSet对象当前行中指定列的值。

abstract int getType()

检索此 ResultSet对象的类型。

abstract URL getURL(int columnIndex)

以Java编程语言中的 ResultSet对象的形式 java.net.URLResultSet对象当前行中指定列的值。

abstract URL getURL(String columnLabel)

以Java编程语言中的 ResultSet对象的形式 java.net.URLResultSet对象当前行中指定列的值。

abstract InputStream getUnicodeStream(int columnIndex)

此方法在API级别1中已弃用。使用getCharacterStream代替getUnicodeStream

abstract InputStream getUnicodeStream(String columnLabel)

此方法在API级别1中已弃用。请改用getCharacterStream

abstract SQLWarning getWarnings()

检索此 ResultSet对象上由调用报告的第一个警告。

abstract void insertRow()

将插入行的内容插入到这个 ResultSet对象中并插入到数据库中。

abstract boolean isAfterLast()

检索光标是否位于此 ResultSet对象中的最后一行之后。

abstract boolean isBeforeFirst()

检索光标是否位于此 ResultSet对象的第一行之前。

abstract boolean isClosed()

检索此 ResultSet对象是否已关闭。

abstract boolean isFirst()

检索光标是否位于此 ResultSet对象的第一行。

abstract boolean isLast()

检索光标是否位于此 ResultSet对象的最后一行。

abstract boolean last()

将光标移动到此 ResultSet对象中的最后一行。

abstract void moveToCurrentRow()

将光标移动到记忆的光标位置,通常是当前行。

abstract void moveToInsertRow()

将光标移动到插入行。

abstract boolean next()

将光标从当前位置移动一行。

abstract boolean previous()

将光标移动 ResultSet对象的 ResultSet的上一行。

abstract void refreshRow()

使用数据库中的最新值刷新当前行。

abstract boolean relative(int rows)

将光标移动相对的行数,无论是正数还是负数。

abstract boolean rowDeleted()

检索一行是否已被删除。

abstract boolean rowInserted()

检索当前行是否有插入。

abstract boolean rowUpdated()

检索当前行是否已更新。

abstract void setFetchDirection(int direction)

给出关于此 ResultSet对象中的行将被处理的方向的提示。

abstract void setFetchSize(int rows)

当此 ResultSet对象需要更多行时,向JDBC驱动程序提示应该从数据库中提取的行数。

abstract void updateArray(String columnLabel, Array x)

java.sql.Array值更新指定的列。

abstract void updateArray(int columnIndex, Array x)

java.sql.Array值更新指定的列。

abstract void updateAsciiStream(int columnIndex, InputStream x)

用ascii流值更新指定的列。

abstract void updateAsciiStream(int columnIndex, InputStream x, long length)

使用ascii流值更新指定列,该值将具有指定的字节数。

abstract void updateAsciiStream(String columnLabel, InputStream x, long length)

使用ascii流值更新指定列,该值将具有指定的字节数。

abstract void updateAsciiStream(String columnLabel, InputStream x)

用ascii流值更新指定的列。

abstract void updateAsciiStream(int columnIndex, InputStream x, int length)

使用ascii流值更新指定列,该值将具有指定的字节数。

abstract void updateAsciiStream(String columnLabel, InputStream x, int length)

使用ascii流值更新指定列,该值将具有指定的字节数。

abstract void updateBigDecimal(int columnIndex, BigDecimal x)

java.math.BigDecimal值更新指定列。

abstract void updateBigDecimal(String columnLabel, BigDecimal x)

java.sql.BigDecimal值更新指定的列。

abstract void updateBinaryStream(int columnIndex, InputStream x, int length)

用二进制流值更新指定列,该值将具有指定的字节数。

abstract void updateBinaryStream(int columnIndex, InputStream x)

用二进制流值更新指定的列。

abstract void updateBinaryStream(String columnLabel, InputStream x, long length)

用二进制流值更新指定列,该值将具有指定的字节数。

abstract void updateBinaryStream(String columnLabel, InputStream x)

用二进制流值更新指定的列。

abstract void updateBinaryStream(String columnLabel, InputStream x, int length)

用二进制流值更新指定列,该值将具有指定的字节数。

abstract void updateBinaryStream(int columnIndex, InputStream x, long length)

用二进制流值更新指定列,该值将具有指定的字节数。

abstract void updateBlob(String columnLabel, Blob x)

java.sql.Blob值更新指定的列。

abstract void updateBlob(String columnLabel, InputStream inputStream)

使用给定的输入流更新指定的列。

abstract void updateBlob(int columnIndex, Blob x)

java.sql.Blob值更新指定列。

abstract void updateBlob(String columnLabel, InputStream inputStream, long length)

使用给定的输入流更新指定的列,该输入流将具有指定的字节数。

abstract void updateBlob(int columnIndex, InputStream inputStream)

使用给定的输入流更新指定的列。

abstract void updateBlob(int columnIndex, InputStream inputStream, long length)

使用给定的输入流更新指定的列,该输入流将具有指定的字节数。

abstract void updateBoolean(String columnLabel, boolean x)

boolean值更新指定的列。

abstract void updateBoolean(int columnIndex, boolean x)

boolean值更新指定的列。

abstract void updateByte(int columnIndex, byte x)

byte值更新指定的列。

abstract void updateByte(String columnLabel, byte x)

byte值更新指定的列。

abstract void updateBytes(int columnIndex, byte[] x)

使用 byte数组值更新指定的列。

abstract void updateBytes(String columnLabel, byte[] x)

用字节数组值更新指定的列。

abstract void updateCharacterStream(String columnLabel, Reader reader, int length)

使用字符流值更新指定的列,该值将具有指定的字节数。

abstract void updateCharacterStream(String columnLabel, Reader reader, long length)

使用字符流值更新指定的列,该值将具有指定的字节数。

abstract void updateCharacterStream(int columnIndex, Reader x, long length)

使用字符流值更新指定的列,该值将具有指定的字节数。

abstract void updateCharacterStream(int columnIndex, Reader x)

用字符流值更新指定的列。

abstract void updateCharacterStream(int columnIndex, Reader x, int length)

使用字符流值更新指定的列,该值将具有指定的字节数。

abstract void updateCharacterStream(String columnLabel, Reader reader)

用字符流值更新指定的列。

abstract void updateClob(int columnIndex, Clob x)

java.sql.Clob值更新指定的列。

abstract void updateClob(String columnLabel, Reader reader)

使用给定的 Reader对象更新指定的列。

abstract void updateClob(String columnLabel, Reader reader, long length)

使用给定的 Reader对象更新指定的列,该对象是给定的字符长度。

abstract void updateClob(int columnIndex, Reader reader)

使用给定的 Reader对象更新指定的列。

abstract void updateClob(int columnIndex, Reader reader, long length)

使用给定的 Reader对象更新指定列,该对象是给定的字符长度。

abstract void updateClob(String columnLabel, Clob x)

java.sql.Clob值更新指定的列。

abstract void updateDate(int columnIndex, Date x)

java.sql.Date值更新指定的列。

abstract void updateDate(String columnLabel, Date x)

java.sql.Date值更新指定的列。

abstract void updateDouble(String columnLabel, double x)

double值更新指定的列。

abstract void updateDouble(int columnIndex, double x)

double值更新指定的列。

abstract void updateFloat(int columnIndex, float x)

float值更新指定的列。

abstract void updateFloat(String columnLabel, float x)

float值更新指定列。

abstract void updateInt(String columnLabel, int x)

int值更新指定的列。

abstract void updateInt(int columnIndex, int x)

int值更新指定的列。

abstract void updateLong(int columnIndex, long x)

long值更新指定的列。

abstract void updateLong(String columnLabel, long x)

long值更新指定的列。

abstract void updateNCharacterStream(int columnIndex, Reader x, long length)

使用字符流值更新指定的列,该值将具有指定的字节数。

abstract void updateNCharacterStream(String columnLabel, Reader reader)

用字符流值更新指定的列。

abstract void updateNCharacterStream(int columnIndex, Reader x)

用字符流值更新指定的列。

abstract void updateNCharacterStream(String columnLabel, Reader reader, long length)

使用字符流值更新指定的列,该值将具有指定的字节数。

abstract void updateNClob(int columnIndex, Reader reader, long length)

使用给定的 Reader对象更新指定列,该对象是给定的字符长度。

abstract void updateNClob(int columnIndex, NClob nClob)

java.sql.NClob值更新指定的列。

abstract void updateNClob(String columnLabel, NClob nClob)

java.sql.NClob值更新指定的列。

abstract void updateNClob(String columnLabel, Reader reader)

使用给定的 Reader对象更新指定的列。

abstract void updateNClob(String columnLabel, Reader reader, long length)

使用给定的 Reader对象更新指定的列,该对象是给定的字符长度。

abstract void updateNClob(int columnIndex, Reader reader)

使用给定的 Reader更新指定列根据需要从数据流中读取数据,直到达到数据流末尾。

abstract void updateNString(String columnLabel, String nString)

String值更新指定的列。

abstract void updateNString(int columnIndex, String nString)

String值更新指定的列。

abstract void updateNull(int columnIndex)

null值更新指定的列。

abstract void updateNull(String columnLabel)

null值更新指定的列。

abstract void updateObject(int columnIndex, Object x)

Object值更新指定的列。

abstract void updateObject(int columnIndex, Object x, int scaleOrLength)

Object值更新指定的列。

abstract void updateObject(String columnLabel, Object x, int scaleOrLength)

Object值更新指定的列。

abstract void updateObject(String columnLabel, Object x)

Object值更新指定的列。

abstract void updateRef(int columnIndex, Ref x)

java.sql.Ref值更新指定的列。

abstract void updateRef(String columnLabel, Ref x)

java.sql.Ref值更新指定的列。

abstract void updateRow()

使用此 ResultSet对象的当前行的新内容更新底层数据库。

abstract void updateRowId(int columnIndex, RowId x)

RowId值更新指定列。

abstract void updateRowId(String columnLabel, RowId x)

RowId值更新指定的列。

abstract void updateSQLXML(int columnIndex, SQLXML xmlObject)

java.sql.SQLXML值更新指定的列。

abstract void updateSQLXML(String columnLabel, SQLXML xmlObject)

java.sql.SQLXML值更新指定的列。

abstract void updateShort(String columnLabel, short x)

short值更新指定的列。

abstract void updateShort(int columnIndex, short x)

short值更新指定的列。

abstract void updateString(String columnLabel, String x)

String值更新指定的列。

abstract void updateString(int columnIndex, String x)

String值更新指定的列。

abstract void updateTime(int columnIndex, Time x)

java.sql.Time值更新指定的列。

abstract void updateTime(String columnLabel, Time x)

java.sql.Time值更新指定的列。

abstract void updateTimestamp(String columnLabel, Timestamp x)

java.sql.Timestamp值更新指定的列。

abstract void updateTimestamp(int columnIndex, Timestamp x)

java.sql.Timestamp值更新指定的列。

abstract boolean wasNull()

报告最后一列的读取值是否为SQL NULL

Inherited methods

From interface java.sql.Wrapper
From interface java.lang.AutoCloseable

Constants

CLOSE_CURSORS_AT_COMMIT

Added in API level 1
int CLOSE_CURSORS_AT_COMMIT

ResultSet当前事务时,指示具有此可保存性的开放 ResultSet对象的常量将被关闭。

常量值:2(0x00000002)

CONCUR_READ_ONLY

Added in API level 1
int CONCUR_READ_ONLY

该常量指示可能无法更新的 ResultSet对象的并发模式。

常量值:1007(0x000003ef)

CONCUR_UPDATABLE

Added in API level 1
int CONCUR_UPDATABLE

该常数指示可能更新的 ResultSet对象的并发模式。

常数值:1008(0x000003f0)

FETCH_FORWARD

Added in API level 1
int FETCH_FORWARD

该常数表示结果集中的行将以正向处理; 第一个到最后。 该常数被方法setFetchDirection用作驱动程序的提示,驱动程序可能会忽略该提示。

常量值:1000(0x000003e8)

FETCH_REVERSE

Added in API level 1
int FETCH_REVERSE

该常数表示结果集中的行将反向处理; 最后到第一位。 该常数被方法setFetchDirection用作驱动程序的提示,驱动程序可能会忽略该提示。

常量值:1001(0x000003e9)

FETCH_UNKNOWN

Added in API level 1
int FETCH_UNKNOWN

该常量指示结果集中行的处理顺序未知。 这个常量被方法setFetchDirection用作驱动程序的提示,驱动程序可能会忽略这个提示。

常量值:1002(0x000003ea)

HOLD_CURSORS_OVER_COMMIT

Added in API level 1
int HOLD_CURSORS_OVER_COMMIT

ResultSet当前事务时,表示具有此可保留性的对象的开放 ResultSet将保持打开。

常数值:1(0x00000001)

TYPE_FORWARD_ONLY

Added in API level 1
int TYPE_FORWARD_ONLY

该常数指示其光标可能仅向前移动的 ResultSet对象的类型。

常量值:1003(0x000003eb)

TYPE_SCROLL_INSENSITIVE

Added in API level 1
int TYPE_SCROLL_INSENSITIVE

该常数指示可滚动的 ResultSet对象的类型,但通常对 ResultSet的数据更改不敏感。

常量值:1004(0x000003ec)

TYPE_SCROLL_SENSITIVE

Added in API level 1
int TYPE_SCROLL_SENSITIVE

该常数指示可滚动的 ResultSet对象的类型,并且通常对 ResultSet的数据更改敏感。

常量值:1005(0x000003ed)

Public methods

absolute

Added in API level 1
boolean absolute (int row)

将光标移动到此 ResultSet对象中的给定行号。

如果行号是正数,则光标将移至相对于结果集开头的给定行号。 第一行是第一行,第二行是第二行,依此类推。

如果给定的行号是负数,则光标将移到相对于结果集结束的绝对行位置。 例如,调用方法absolute(-1)将光标定位在最后一行; 调用方法absolute(-2)将光标移动到倒数第二行,依此类推。

如果指定的行号为零,则光标移至第一行之前。

尝试将光标放在结果集中第一行/最后一行之外时,会将光标留在第一行之前或最后一行之后。

注意:拨打absolute(1)与拨打first()相同。 调用absolute(-1)与调用last()相同。

Parameters
row int: the number of the row to which the cursor should move. A value of zero indicates that the cursor will be positioned before the first row; a positive number indicates the row number counting from the beginning of the result set; a negative number indicates the row number counting from the end of the result set
Returns
boolean true if the cursor is moved to a position in this ResultSet object; false if the cursor is before the first row or after the last row
Throws
SQLException if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

afterLast

Added in API level 1
void afterLast ()

将光标移动到最后一行后面的ResultSet对象的末尾。 如果结果集不包含任何行,则此方法不起作用。

Throws
SQLException if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

beforeFirst

Added in API level 1
void beforeFirst ()

将光标移动到该前方ResultSet正好位于第一行之前的对象。 如果结果集不包含任何行,则此方法不起作用。

Throws
SQLException if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

cancelRowUpdates

Added in API level 1
void cancelRowUpdates ()

取消对此ResultSet对象中的当前行进行的更新。 可以在调用更新器方法之后以及调用方法updateRow来回滚对行进行的更新之前调用此方法。 如果没有更新或已经调用updateRow ,则此方法不起作用。

Throws
SQLException if a database access error occurs; this method is called on a closed result set; the result set concurrency is CONCUR_READ_ONLY or if this method is called when the cursor is on the insert row
SQLFeatureNotSupportedException if the JDBC driver does not support this method

clearWarnings

Added in API level 1
void clearWarnings ()

清除此ResultSet对象上报告的所有警告。 在调用此方法后,方法getWarnings将返回null直到为此ResultSet对象报告新警告为止。

Throws
SQLException if a database access error occurs or this method is called on a closed result set

close

Added in API level 1
void close ()

立即释放此 ResultSet对象的数据库和JDBC资源,而不是在它自动关闭时等待它发生。

一个的闭合ResultSet对象关闭BlobClobNClob由创建的对象ResultSet BlobClobNClob对象为其中它们creataed,除非他们的交易的至少持续时间保持有效free方法被调用。

ResultSet关闭时,通过调用 getMetaData方法创建的任何 ResultSetMetaData实例仍可访问。

注意:Statement对象关闭,重新执行或用于从多个结果序列中检索下一个结果时, ResultSet对象会自动由 Statement对象关闭,该对象会生成该对象。

在已经关闭的 ResultSet对象上调用方法 close是无操作的。

Throws
SQLException if a database access error occurs

deleteRow

Added in API level 1
void deleteRow ()

从此ResultSet对象和底层数据库中删除当前行。 当光标位于插入行上时,不能调用此方法。

Throws
SQLException if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY; this method is called on a closed result set or if this method is called when the cursor is on the insert row
SQLFeatureNotSupportedException if the JDBC driver does not support this method

findColumn

Added in API level 1
int findColumn (String columnLabel)

将给定的 ResultSet列标签映射到其 ResultSet列索引。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
int the column index of the given column name
Throws
SQLException if the ResultSet object does not contain a column labeled columnLabel, a database access error occurs or this method is called on a closed result set

first

Added in API level 1
boolean first ()

将光标移动到此 ResultSet对象的第一行。

Returns
boolean true if the cursor is on a valid row; false if there are no rows in the result set
Throws
SQLException if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getArray

Added in API level 1
Array getArray (int columnIndex)

以Java编程语言中的 ResultSet对象的形式 ArrayResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
Array an Array object representing the SQL ARRAY value in the specified column
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getArray

Added in API level 1
Array getArray (String columnLabel)

以Java编程语言中的 ResultSet对象的形式 ArrayResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
Array an Array object representing the SQL ARRAY value in the specified column
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getAsciiStream

Added in API level 1
InputStream getAsciiStream (int columnIndex)

以ASCII字符流的形式检索此ResultSet对象当前行中指定列的值。 然后可以从流中读取该块的值。 该方法特别适用于获取大LONGVARCHAR值。 JDBC驱动程序将执行从数据库格式到ASCII的任何必要转换。

注意:必须在获取任何其他列的值之前读取返回流中的所有数据。 下一次调用getter方法会隐式关闭流。 此外,一个流可以返回0当方法InputStream.available称为是否存在可用的或不是数据。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
InputStream a Java input stream that delivers the database column value as a stream of one-byte ASCII characters; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getAsciiStream

Added in API level 1
InputStream getAsciiStream (String columnLabel)

以ASCII字符流的形式检索此ResultSet对象当前行中指定列的值。 然后可以从流中读取该块的值。 该方法特别适用于检索较大的LONGVARCHAR值。 JDBC驱动程序将执行从数据库格式到ASCII的任何必要转换。

注意:必须在获取任何其他列的值之前读取返回流中的所有数据。 下一次调用getter方法会隐式关闭流。 此外,一个流可以返回0当方法available称为是否存在可用的或不是数据。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
InputStream a Java input stream that delivers the database column value as a stream of one-byte ASCII characters. If the value is SQL NULL, the value returned is null.
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getBigDecimal

Added in API level 1
BigDecimal getBigDecimal (String columnLabel)

完全精确地以 java.math.BigDecimalResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
BigDecimal the column value (full precision); if the value is SQL NULL, the value returned is null in the Java programming language.
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getBigDecimal

Added in API level 1
BigDecimal getBigDecimal (String columnLabel, 
                int scale)

此方法在API级别1中已弃用。
弃用

以Java编程语言中的 java.math.BigDecimalResultSet对象的当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
scale int: the number of digits to the right of the decimal point
Returns
BigDecimal the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getBigDecimal

Added in API level 1
BigDecimal getBigDecimal (int columnIndex, 
                int scale)

此方法在API级别1中已弃用。
弃用

以Java编程语言中的 java.sql.BigDecimalResultSet对象的当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
scale int: the number of digits to the right of the decimal point
Returns
BigDecimal the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getBigDecimal

Added in API level 1
BigDecimal getBigDecimal (int columnIndex)

java.math.BigDecimal的全精度检索此 ResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
BigDecimal the column value (full precision); if the value is SQL NULL, the value returned is null in the Java programming language.
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getBinaryStream

Added in API level 1
InputStream getBinaryStream (String columnLabel)

以未解释的byte s的形式检索此ResultSet对象当前行中指定列的值。 然后可以从流中读取该块的值。 该方法特别适用于检索较大的LONGVARBINARY值。

注意:必须在获取任何其他列的值之前读取返回流中的所有数据。 下一次调用getter方法会隐式关闭流。 此外,一个流可以返回0当方法available称为是否存在可用的或不是数据。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
InputStream a Java input stream that delivers the database column value as a stream of uninterpreted bytes; if the value is SQL NULL, the result is null
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getBinaryStream

Added in API level 1
InputStream getBinaryStream (int columnIndex)

以未解释的字节流的形式检索此ResultSet对象当前行中指定列的值。 然后可以从流中读取该块的值。 该方法特别适用于检索较大的LONGVARBINARY值。

注意:必须在获取任何其他列的值之前读取返回流中的所有数据。 下一次调用getter方法会隐式关闭流。 此外,一个流可以返回0当方法InputStream.available称为是否存在可用的或不是数据。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
InputStream a Java input stream that delivers the database column value as a stream of uninterpreted bytes; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getBlob

Added in API level 1
Blob getBlob (int columnIndex)

以Java编程语言中的 ResultSet对象的形式 BlobResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
Blob a Blob object representing the SQL BLOB value in the specified column
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getBlob

Added in API level 1
Blob getBlob (String columnLabel)

以Java编程语言中的 ResultSet对象的形式 BlobResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
Blob a Blob object representing the SQL BLOB value in the specified column
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getBoolean

Added in API level 1
boolean getBoolean (String columnLabel)

以Java编程语言中的 booleanResultSet对象当前行中指定列的值。

如果指定的列具有CHAR或VARCHAR的数据类型并且包含“0”或具有BIT,TINYINT,SMALLINT,INTEGER或BIGINT的数据类型并且包含0,则返回值false 如果指定的列具有CHAR或VARCHAR的数据类型并且包含“1”或具有BIT,TINYINT,SMALLINT,INTEGER或BIGINT的数据类型并且包含1,则返回值true

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
boolean the column value; if the value is SQL NULL, the value returned is false
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getBoolean

Added in API level 1
boolean getBoolean (int columnIndex)

以Java编程语言中的 booleanResultSet对象当前行中指定列的值。

如果指定的列具有CHAR或VARCHAR的数据类型并且包含“0”或具有BIT,TINYINT,SMALLINT,INTEGER或BIGINT的数据类型且包含0,则返回值false 如果指定的列具有CHAR或VARCHAR的数据类型并且包含“1”或具有BIT,TINYINT,SMALLINT,INTEGER或BIGINT的数据类型并且包含1,则返回值true

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
boolean the column value; if the value is SQL NULL, the value returned is false
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getByte

Added in API level 1
byte getByte (String columnLabel)

以Java编程语言中的 byteResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
byte the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getByte

Added in API level 1
byte getByte (int columnIndex)

以Java编程语言中的 byteResultSet对象的当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
byte the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getBytes

Added in API level 1
byte[] getBytes (String columnLabel)

以Java编程语言中的byte数组检索此ResultSet对象当前行中指定列的值。 字节表示驱动程序返回的原始值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
byte[] the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getBytes

Added in API level 1
byte[] getBytes (int columnIndex)

以Java编程语言中的byte数组检索此ResultSet对象当前行中指定列的值。 字节表示驱动程序返回的原始值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
byte[] the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getCharacterStream

Added in API level 1
Reader getCharacterStream (int columnIndex)

ResultSet对象的形式 java.io.ReaderResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
Reader a java.io.Reader object that contains the column value; if the value is SQL NULL, the value returned is null in the Java programming language.
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getCharacterStream

Added in API level 1
Reader getCharacterStream (String columnLabel)

ResultSet对象的形式 java.io.ReaderResultSet对象的当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
Reader a java.io.Reader object that contains the column value; if the value is SQL NULL, the value returned is null in the Java programming language
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getClob

Added in API level 1
Clob getClob (int columnIndex)

以Java编程语言中的 ResultSet对象的形式 ClobResultSet对象的当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
Clob a Clob object representing the SQL CLOB value in the specified column
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getClob

Added in API level 1
Clob getClob (String columnLabel)

以Java编程语言中的 ResultSet对象的形式 ClobResultSet对象的当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
Clob a Clob object representing the SQL CLOB value in the specified column
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getConcurrency

Added in API level 1
int getConcurrency ()

检索此ResultSet对象的并发模式。 使用的并发性由创建结果集的Statement对象决定。

Returns
int the concurrency type, either ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
Throws
SQLException if a database access error occurs or this method is called on a closed result set

getCursorName

Added in API level 1
String getCursorName ()

检索此 ResultSet对象使用的SQL游标的名称。

在SQL中,通过名为的游标检索结果表。 可以使用引用光标名称的定位更新/删除语句来更新或删除结果集的当前行。 为确保游标具有适当的隔离级别以支持更新,游标的SELECT语句的格式应为SELECT FOR UPDATE 如果省略FOR UPDATE ,则定位的更新可能会失败。

JDBC API通过提供ResultSet对象所使用的SQL游标的名称来支持此SQL功能。 ResultSet对象的当前行也是此SQL游标的当前行。

Returns
String the SQL name for this ResultSet object's cursor
Throws
SQLException if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getDate

Added in API level 1
Date getDate (int columnIndex)

以Java编程语言中的 ResultSet对象的形式 java.sql.DateResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
Date the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getDate

Added in API level 1
Date getDate (String columnLabel)

以Java编程语言中的 ResultSet对象的形式 java.sql.DateResultSet对象的当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
Date the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getDate

Added in API level 1
Date getDate (String columnLabel, 
                Calendar cal)

以Java编程语言中的ResultSet对象的形式java.sql.DateResultSet对象的当前行中指定列的值。 如果底层数据库不存储时区信息,则此方法使用给定的日历为日期构造适当的毫秒值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
cal Calendar: the java.util.Calendar object to use in constructing the date
Returns
Date the column value as a java.sql.Date object; if the value is SQL NULL, the value returned is null in the Java programming language
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getDate

Added in API level 1
Date getDate (int columnIndex, 
                Calendar cal)

以Java编程语言中的ResultSet对象的形式java.sql.DateResultSet对象的当前行中指定列的值。 如果底层数据库不存储时区信息,则此方法使用给定的日历为日期构造适当的毫秒值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
cal Calendar: the java.util.Calendar object to use in constructing the date
Returns
Date the column value as a java.sql.Date object; if the value is SQL NULL, the value returned is null in the Java programming language
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getDouble

Added in API level 1
double getDouble (int columnIndex)

以Java编程语言中的 doubleResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
double the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getDouble

Added in API level 1
double getDouble (String columnLabel)

以Java编程语言中的 doubleResultSet对象的当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
double the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getFetchDirection

Added in API level 1
int getFetchDirection ()

检索此 ResultSet对象的获取方向。

Returns
int the current fetch direction for this ResultSet object
Throws
SQLException if a database access error occurs or this method is called on a closed result set

也可以看看:

getFetchSize

Added in API level 1
int getFetchSize ()

检索此 ResultSet对象的获取大小。

Returns
int the current fetch size for this ResultSet object
Throws
SQLException if a database access error occurs or this method is called on a closed result set

也可以看看:

getFloat

Added in API level 1
float getFloat (String columnLabel)

以Java编程语言中的 floatResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
float the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getFloat

Added in API level 1
float getFloat (int columnIndex)

以Java编程语言中的 floatResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
float the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getHoldability

Added in API level 9
int getHoldability ()

检索此 ResultSet对象的可保存性

Returns
int either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Throws
SQLException if a database access error occurs or this method is called on a closed result set

getInt

Added in API level 1
int getInt (int columnIndex)

以Java编程语言中的 intResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
int the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getInt

Added in API level 1
int getInt (String columnLabel)

以Java编程语言中的 intResultSet对象的当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
int the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getLong

Added in API level 1
long getLong (String columnLabel)

以Java编程语言中的 longResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
long the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getLong

Added in API level 1
long getLong (int columnIndex)

以Java编程语言中的 longResultSet对象的当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
long the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getMetaData

Added in API level 1
ResultSetMetaData getMetaData ()

检索此 ResultSet对象列的数量,类型和属性。

Returns
ResultSetMetaData the description of this ResultSet object's columns
Throws
SQLException if a database access error occurs or this method is called on a closed result set

getNCharacterStream

Added in API level 9
Reader getNCharacterStream (int columnIndex)

ResultSet对象的形式java.io.ReaderResultSet对象的当前行中指定列的值。 访问时,它适用于使用NCHARNVARCHARLONGNVARCHAR列。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
Reader a java.io.Reader object that contains the column value; if the value is SQL NULL, the value returned is null in the Java programming language.
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getNCharacterStream

Added in API level 9
Reader getNCharacterStream (String columnLabel)

ResultSet对象的形式java.io.ReaderResultSet对象的当前行中指定列的值。 访问时,它适用于使用NCHARNVARCHARLONGNVARCHAR列。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
Reader a java.io.Reader object that contains the column value; if the value is SQL NULL, the value returned is null in the Java programming language
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getNClob

Added in API level 9
NClob getNClob (String columnLabel)

以Java编程语言中的 ResultSet对象的形式 NClobResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
NClob a NClob object representing the SQL NCLOB value in the specified column
Throws
SQLException if the columnLabel is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; this method is called on a closed result set or if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getNClob

Added in API level 9
NClob getNClob (int columnIndex)

以Java编程语言中的 ResultSet对象的形式 NClobResultSet对象的当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
NClob a NClob object representing the SQL NCLOB value in the specified column
Throws
SQLException if the columnIndex is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; this method is called on a closed result set or if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getNString

Added in API level 9
String getNString (String columnLabel)

以Java编程语言中的StringResultSet对象当前行中指定列的值。 访问时,它适用于使用NCHARNVARCHARLONGNVARCHAR列。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
String the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getNString

Added in API level 9
String getNString (int columnIndex)

以Java编程语言中的StringResultSet对象当前行中指定列的值。 访问时,它适用于使用NCHARNVARCHARLONGNVARCHAR列。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
String the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getObject

Added in API level 1
Object getObject (int columnIndex)

以Java编程语言中的 Object获取此 ResultSet对象当前行中指定列的值。

此方法将以Java对象的形式返回给定列的值。 根据JDBC规范中指定的内置类型的映射,Java对象的类型将是与列的SQL类型对应的默认Java对象类型。 如果该值是一个SQL NULL ,则该驱动程序将返回一个Java null

此方法也可用于读取数据库特定的抽象数据类型。 在JDBC 2.0 API中,方法getObject的行为被扩展为实现SQL用户定义类型的数据。

如果Connection.getTypeMap不会抛出SQLFeatureNotSupportedException ,那么当列包含结构化值或不同值时,此方法的行为就好像是对getObject(columnIndex, this.getStatement().getConnection().getTypeMap())的调用。 如果Connection.getTypeMap确实会抛出SQLFeatureNotSupportedException ,则不支持结构化值,并且将不同值映射到由DISTINCT类型的基础SQL类型确定的默认Java类。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
Object a java.lang.Object holding the column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getObject

Added in API level 1
Object getObject (String columnLabel)

以Java编程语言中的 Object获取此 ResultSet对象当前行中指定列的值。

此方法将以Java对象的形式返回给定列的值。 根据JDBC规范中指定的内置类型的映射,Java对象的类型将是与列的SQL类型对应的默认Java对象类型。 如果该值是SQL NULL ,则该驱动程序将返回Java null

此方法也可用于读取数据库特定的抽象数据类型。

在JDBC 2.0 API中,扩展了方法getObject的行为以实现SQL用户定义类型的数据。 当列包含结构化或不同的值时,此方法的行为就好像是对getObject(columnIndex, this.getStatement().getConnection().getTypeMap())的调用。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
Object a java.lang.Object holding the column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getObject

Added in API level 1
Object getObject (int columnIndex, 
                Map<StringClass<?>> map)

以Java编程语言中的ObjectResultSet对象当前行中指定列的值。 如果该值是SQL NULL ,则驱动程序将返回Java null 此方法将给定的Map对象用于正在检索的SQL结构化或不同类型的自定义映射。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
map Map: a java.util.Map object that contains the mapping from SQL type names to classes in the Java programming language
Returns
Object an Object in the Java programming language representing the SQL value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getObject

Added in API level 1
Object getObject (String columnLabel, 
                Map<StringClass<?>> map)

以Java编程语言中的ObjectResultSet对象当前行中指定列的值。 如果该值是SQL NULL ,则驱动程序将返回Java null 如果适用,此方法使用指定的Map对象进行自定义映射。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
map Map: a java.util.Map object that contains the mapping from SQL type names to classes in the Java programming language
Returns
Object an Object representing the SQL value in the specified column
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getRef

Added in API level 1
Ref getRef (int columnIndex)

以Java编程语言中的 ResultSet对象的形式 RefResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
Ref a Ref object representing an SQL REF value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getRef

Added in API level 1
Ref getRef (String columnLabel)

以Java编程语言中的 ResultSet对象的形式 RefResultSet对象的当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
Ref a Ref object representing the SQL REF value in the specified column
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getRow

Added in API level 1
int getRow ()

检索当前行号。 第一行是数字1,第二个数字2,依此类推。

注意:支持 getRow方法是 ResultSet的可选方法,结果集类型为 TYPE_FORWARD_ONLY

Returns
int the current row number; 0 if there is no current row
Throws
SQLException if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getRowId

Added in API level 9
RowId getRowId (int columnIndex)

以Java编程语言中的 ResultSet对象的形式 java.sql.RowIdResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second 2, ...
Returns
RowId the column value; if the value is a SQL NULL the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getRowId

Added in API level 9
RowId getRowId (String columnLabel)

以Java编程语言中的 ResultSet对象的形式 java.sql.RowIdResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
RowId the column value ; if the value is a SQL NULL the value returned is null
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getSQLXML

Added in API level 9
SQLXML getSQLXML (String columnLabel)

以Java编程语言中的 java.sql.SQLXML对象的形式获取此 ResultSet的当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
SQLXML a SQLXML object that maps an SQL XML value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getSQLXML

Added in API level 9
SQLXML getSQLXML (int columnIndex)

以Java编程语言中的 java.sql.SQLXML对象的形式 java.sql.SQLXMLResultSet的当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
SQLXML a SQLXML object that maps an SQL XML value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getShort

Added in API level 1
short getShort (String columnLabel)

以Java编程语言中的 shortResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
short the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getShort

Added in API level 1
short getShort (int columnIndex)

以Java编程语言中的 shortResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
short the column value; if the value is SQL NULL, the value returned is 0
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getStatement

Added in API level 1
Statement getStatement ()

检索Statement生成此对象ResultSet对象。 如果结果集是以其他方式生成的,例如通过DatabaseMetaData方法,则此方法可能会返回null

Returns
Statement the Statment object that produced this ResultSet object or null if the result set was produced some other way
Throws
SQLException if a database access error occurs or this method is called on a closed result set

getString

Added in API level 1
String getString (int columnIndex)

以Java编程语言中的 StringResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
String the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getString

Added in API level 1
String getString (String columnLabel)

以Java编程语言中的 StringResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
String the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getTime

Added in API level 1
Time getTime (String columnLabel)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimeResultSet对象的当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
Time the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getTime

Added in API level 1
Time getTime (String columnLabel, 
                Calendar cal)

以Java编程语言中的ResultSet对象的形式java.sql.TimeResultSet对象的当前行中指定列的值。 如果底层数据库不存储时区信息,则此方法使用给定日历为该时间构造适当的毫秒值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
cal Calendar: the java.util.Calendar object to use in constructing the time
Returns
Time the column value as a java.sql.Time object; if the value is SQL NULL, the value returned is null in the Java programming language
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getTime

Added in API level 1
Time getTime (int columnIndex)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimeResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
Time the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getTime

Added in API level 1
Time getTime (int columnIndex, 
                Calendar cal)

以Java编程语言中的ResultSet对象的形式java.sql.TimeResultSet对象的当前行中指定列的值。 如果底层数据库不存储时区信息,则此方法使用给定日历为该时间构造适当的毫秒值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
cal Calendar: the java.util.Calendar object to use in constructing the time
Returns
Time the column value as a java.sql.Time object; if the value is SQL NULL, the value returned is null in the Java programming language
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getTimestamp

Added in API level 1
Timestamp getTimestamp (int columnIndex, 
                Calendar cal)

以Java编程语言中的ResultSet对象的形式java.sql.TimestampResultSet对象当前行中指定列的值。 如果底层数据库不存储时区信息,则此方法使用给定的日历为时间戳创建适当的毫秒值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
cal Calendar: the java.util.Calendar object to use in constructing the timestamp
Returns
Timestamp the column value as a java.sql.Timestamp object; if the value is SQL NULL, the value returned is null in the Java programming language
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getTimestamp

Added in API level 1
Timestamp getTimestamp (int columnIndex)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimestampResultSet对象当前行中指定列的值。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
Timestamp the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set

getTimestamp

Added in API level 1
Timestamp getTimestamp (String columnLabel, 
                Calendar cal)

以Java编程语言中的ResultSet对象的形式java.sql.TimestampResultSet对象当前行中指定列的值。 如果底层数据库不存储时区信息,则此方法使用给定的日历为时间戳创建适当的毫秒值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
cal Calendar: the java.util.Calendar object to use in constructing the date
Returns
Timestamp the column value as a java.sql.Timestamp object; if the value is SQL NULL, the value returned is null in the Java programming language
Throws
SQLException if the columnLabel is not valid or if a database access error occurs or this method is called on a closed result set

getTimestamp

Added in API level 1
Timestamp getTimestamp (String columnLabel)

以Java编程语言中的 ResultSet对象的形式 java.sql.TimestampResultSet对象的当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
Timestamp the column value; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set

getType

Added in API level 1
int getType ()

检索此ResultSet对象的类型。 该类型由创建结果集的Statement对象确定。

Returns
int ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
Throws
SQLException if a database access error occurs or this method is called on a closed result set

getURL

Added in API level 1
URL getURL (int columnIndex)

以Java编程语言中的 ResultSet对象的形式 java.net.URLResultSet对象的当前行中指定列的值。

Parameters
columnIndex int: the index of the column 1 is the first, 2 is the second,...
Returns
URL the column value as a java.net.URL object; if the value is SQL NULL, the value returned is null in the Java programming language
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; this method is called on a closed result set or if a URL is malformed
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getURL

Added in API level 1
URL getURL (String columnLabel)

以Java编程语言中的 ResultSet对象的形式 java.net.URLResultSet对象当前行中指定列的值。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
URL the column value as a java.net.URL object; if the value is SQL NULL, the value returned is null in the Java programming language
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; this method is called on a closed result set or if a URL is malformed
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getUnicodeStream

Added in API level 1
InputStream getUnicodeStream (int columnIndex)

此方法在API级别1中已弃用。
getCharacterStream代替getUnicodeStream

检索此ResultSet对象当前行中指定列的值,作为两个字节的3个字符的流。 第一个字节是高字节; 第二个字节是低字节。 然后可以从流中读取该块的值。 该方法特别适用于获取大LONGVARCHAR值。 JDBC驱动程序将执行从数据库格式到Unicode的任何必要转换。

注意:必须在获取任何其他列的值之前读取返回流中的所有数据。 下一次调用getter方法会隐式关闭流。 此外,一个流可以返回0当方法InputStream.available被调用时,是否有数据可用。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Returns
InputStream a Java input stream that delivers the database column value as a stream of two-byte Unicode characters; if the value is SQL NULL, the value returned is null
Throws
SQLException if the columnIndex is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getUnicodeStream

Added in API level 1
InputStream getUnicodeStream (String columnLabel)

此方法在API级别1中已弃用。
改为使用getCharacterStream

以双字节Unicode字符流的形式检索此ResultSet对象当前行中指定列的值。 第一个字节是高字节; 第二个字节是低字节。 然后可以从流中读取该块的值。 该方法特别适用于检索较大的LONGVARCHAR值。 启用JDBC技术的驱动程序将执行从数据库格式到Unicode的任何必要转换。

注意:必须在获取任何其他列的值之前读取返回流中的所有数据。 下一次调用getter方法会隐式关闭流。 此外,一个流可以返回0当方法InputStream.available被调用时,是否有数据可用。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Returns
InputStream a Java input stream that delivers the database column value as a stream of two-byte Unicode characters. If the value is SQL NULL, the value returned is null.
Throws
SQLException if the columnLabel is not valid; if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

getWarnings

Added in API level 1
SQLWarning getWarnings ()

检索此ResultSet对象通过调用报告的第一个警告。 ResultSet对象上的后续警告将被链接到此方法返回的SQLWarning对象。

每次读取新行时,警告链都会自动清除。 可能未在已关闭的ResultSet对象上调用此方法; 这样做会导致抛出SQLException

注意:此警告链只包含由ResultSet方法引起的警告。 Statement方法引起的任何警告(例如读取OUT参数)将被链接在Statement对象上。

Returns
SQLWarning the first SQLWarning object reported or null if there are none
Throws
SQLException if a database access error occurs or this method is called on a closed result set

insertRow

Added in API level 1
void insertRow ()

将插入行的内容插入此ResultSet对象和数据库中。 调用此方法时,游标必须位于插入行上。

Throws
SQLException if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY, this method is called on a closed result set, if this method is called when the cursor is not on the insert row, or if not all of non-nullable columns in the insert row have been given a non-null value
SQLFeatureNotSupportedException if the JDBC driver does not support this method

isAfterLast

Added in API level 1
boolean isAfterLast ()

检索光标是否位于此 ResultSet对象中的最后一行之后。

注意:支持 isAfterLast方法对于 ResultSet是可选的,结果集类型为 TYPE_FORWARD_ONLY

Returns
boolean true if the cursor is after the last row; false if the cursor is at any other position or the result set contains no rows
Throws
SQLException if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

isBeforeFirst

Added in API level 1
boolean isBeforeFirst ()

检索光标是否位于此 ResultSet对象的第一行之前。

注:支持为 isBeforeFirst方法是可选的 ResultSet s的一个结果集类型 TYPE_FORWARD_ONLY

Returns
boolean true if the cursor is before the first row; false if the cursor is at any other position or the result set contains no rows
Throws
SQLException if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

isClosed

Added in API level 9
boolean isClosed ()

检索此ResultSet对象是否已关闭。 如果方法关闭已被调用,或者自动关闭,则ResultSet将关闭。

Returns
boolean true if this ResultSet object is closed; false if it is still open
Throws
SQLException if a database access error occurs

isFirst

Added in API level 1
boolean isFirst ()

检索光标是否位于此 ResultSet对象的第一行。

注:支持为 isFirst方法是可选的 ResultSet s的一个结果集类型 TYPE_FORWARD_ONLY

Returns
boolean true if the cursor is on the first row; false otherwise
Throws
SQLException if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

isLast

Added in API level 1
boolean isLast ()

检索光标是否位于此ResultSet对象的最后一行。 注意:调用方法isLast可能会很昂贵,因为JDBC驱动程序可能需要提前读取一行以确定当前行是否为结果集中的最后一行。

注意:支持 isLast方法对于 ResultSet是可选的,结果集类型为 TYPE_FORWARD_ONLY

Returns
boolean true if the cursor is on the last row; false otherwise
Throws
SQLException if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

last

Added in API level 1
boolean last ()

将光标移到此 ResultSet对象中的最后一行。

Returns
boolean true if the cursor is on a valid row; false if there are no rows in the result set
Throws
SQLException if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

moveToCurrentRow

Added in API level 1
void moveToCurrentRow ()

将光标移动到记忆的光标位置,通常是当前行。 如果游标不在插入行上,则此方法不起作用。

Throws
SQLException if a database access error occurs; this method is called on a closed result set or the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

moveToInsertRow

Added in API level 1
void moveToInsertRow ()

将光标移动到插入行。 当光标位于插入行上时,当前光标位置被记住。 插入行是与可更新结果集关联的特殊行。 它本质上是一个缓冲区,在将行插入结果集之前,可以通过调用updater方法来构造新行。 当光标位于插入行上时,只有更新程序,getter和insertRow方法可能会被调用。 调用结果集中的所有列必须在调用insertRow之前每次调用此方法时给定一个值。 在可以在列值上调用getter方法之前,必须调用updater方法。

Throws
SQLException if a database access error occurs; this method is called on a closed result set or the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

next

Added in API level 1
boolean next ()

将光标从当前位置移动一行。 一个ResultSet光标最初位于第一行之前; 对方法next的第一个调用使第一行成为当前行; 第二次调用使第二行成为当前行,依此类推。

当对next方法的调用返回false ,光标位于最后一行之后。 任何需要当前行的ResultSet方法调用都会导致抛出SQLException 如果结果集类型为TYPE_FORWARD_ONLY ,它是指定的JDBC驱动程序实现是否会返回供应商false或抛出SQLException上的后续调用next

如果输入流对当前行打开,则调用方法next将隐式关闭它。 当读取新行时, ResultSet对象的警告链将被清除。

Returns
boolean true if the new current row is valid; false if there are no more rows
Throws
SQLException if a database access error occurs or this method is called on a closed result set

previous

Added in API level 1
boolean previous ()

将光标移到此 ResultSet对象中的上一行。

当对previous方法的调用返回false ,光标位于第一行之前。 任何需要当前行的ResultSet方法的调用都会导致抛出SQLException

如果输入流对当前行打开,则调用方法previous将隐式关闭它。 当读取新行时, ResultSet对象的警告更改被清除。

Returns
boolean true if the cursor is now positioned on a valid row; false if the cursor is positioned before the first row
Throws
SQLException if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

refreshRow

Added in API level 1
void refreshRow ()

使用数据库中的最新值刷新当前行。 当光标位于插入行上时,不能调用此方法。

refreshRow方法为应用程序提供了一种方式,可以明确告诉JDBC驱动程序从数据库中重新获取行。 当JDBC驱动程序正在执行高速缓存或预取时,应用程序可能需要调用refreshRow以从数据库中获取最新的行值。 如果提取大小大于1,则JDBC驱动程序可能实际上一次刷新多行。

所有值都会根据事务隔离级别和光标灵敏度进行重新设置。 如果在调用更新方法之后调用refreshRow ,但在调用方法updateRow之前,则对该行进行的更新将丢失。 经常调用方法refreshRow可能会降低性能。

Throws
SQLException if a database access error occurs; this method is called on a closed result set; the result set type is TYPE_FORWARD_ONLY or if this method is called when the cursor is on the insert row
SQLFeatureNotSupportedException if the JDBC driver does not support this method or this method is not supported for the specified result set type and result set concurrency.

relative

Added in API level 1
boolean relative (int rows)

将光标移动相对的行数,无论是正数还是负数。 试图超出结果集中的第一行/最后一行,将光标定位在第一行/最后一行之前/之后。 调用relative(0)是有效的,但不会更改光标位置。

注:调用方法 relative(1)是相同的调用方法 next()并调用方法 relative(-1)是相同的调用方法 previous()

Parameters
rows int: an int specifying the number of rows to move from the current row; a positive number moves the cursor forward; a negative number moves the cursor backward
Returns
boolean true if the cursor is on a row; false otherwise
Throws
SQLException if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

rowDeleted

Added in API level 1
boolean rowDeleted ()

检索一行是否已被删除。 删除的行可能在结果集中留下可见的“洞”。 该方法可用于检测结果集中的孔。 返回的值取决于此ResultSet对象是否可以检测到删除。

注意:支持 rowDeleted方法是可选的,结果集并发性为 CONCUR_READ_ONLY

Returns
boolean true if the current row is detected to have been deleted by the owner or another; false otherwise
Throws
SQLException if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

也可以看看:

rowInserted

Added in API level 1
boolean rowInserted ()

检索当前行是否有插入。 返回的值取决于是否这ResultSet对象可以检测可见插入。

注意:支持 rowInserted方法是可选的,结果集并发性为 CONCUR_READ_ONLY

Returns
boolean true if the current row is detected to have been inserted; false otherwise
Throws
SQLException if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

也可以看看:

rowUpdated

Added in API level 1
boolean rowUpdated ()

检索当前行是否已更新。 返回的值取决于结果集是否可以检测到更新。

注意:支持 rowUpdated方法是可选的,结果集并发性为 CONCUR_READ_ONLY

Returns
boolean true if the current row is detected to have been visibly updated by the owner or another; false otherwise
Throws
SQLException if a database access error occurs or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

也可以看看:

setFetchDirection

Added in API level 1
void setFetchDirection (int direction)

给出关于此ResultSet对象中的行将被处理的方向的提示。 初始值由生成此ResultSet对象的Statement对象确定。 读取方向可能随时更改。

Parameters
direction int: an int specifying the suggested fetch direction; one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or ResultSet.FETCH_UNKNOWN
Throws
SQLException if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY and the fetch direction is not FETCH_FORWARD

也可以看看:

setFetchSize

Added in API level 1
void setFetchSize (int rows)

当此ResultSet对象需要更多行时,向JDBC驱动程序提示应该从数据库中提取的行数。 如果指定的读取大小为零,那么JDBC驱动程序将忽略该值,并可自由地对自己的读取大小进行自己的最佳猜测。 默认值由创建结果集的Statement对象设置。 提取大小可能会随时更改。

Parameters
rows int: the number of rows to fetch
Throws
SQLException if a database access error occurs; this method is called on a closed result set or the condition rows >= 0 is not satisfied

也可以看看:

updateArray

Added in API level 1
void updateArray (String columnLabel, 
                Array x)

java.sql.Array值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x Array: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateArray

Added in API level 1
void updateArray (int columnIndex, 
                Array x)

java.sql.Array值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Array: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateAsciiStream

Added in API level 9
void updateAsciiStream (int columnIndex, 
                InputStream x)

用ascii流值更新指定的列。 数据将根据需要从流中读取,直到达到流结束。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注意:请查阅您的JDBC驱动程序文档以确定使用带有长度参数的 updateAsciiStream版本是否更有效。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x InputStream: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateAsciiStream

Added in API level 9
void updateAsciiStream (int columnIndex, 
                InputStream x, 
                long length)

使用ascii流值更新指定列,该值将具有指定的字节数。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x InputStream: the new column value
length long: the length of the stream
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateAsciiStream

Added in API level 9
void updateAsciiStream (String columnLabel, 
                InputStream x, 
                long length)

使用ascii流值更新指定列,该值将具有指定的字节数。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x InputStream: the new column value
length long: the length of the stream
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateAsciiStream

Added in API level 9
void updateAsciiStream (String columnLabel, 
                InputStream x)

用ascii流值更新指定的列。 数据将根据需要从流中读取,直到达到流结束。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注:请查阅您的JDBC驱动程序文档以确定使用带有长度参数的 updateAsciiStream版本是否更有效。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x InputStream: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateAsciiStream

Added in API level 1
void updateAsciiStream (int columnIndex, 
                InputStream x, 
                int length)

使用ascii流值更新指定列,该值将具有指定的字节数。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x InputStream: the new column value
length int: the length of the stream
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateAsciiStream

Added in API level 1
void updateAsciiStream (String columnLabel, 
                InputStream x, 
                int length)

使用ascii流值更新指定列,该值将具有指定的字节数。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x InputStream: the new column value
length int: the length of the stream
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBigDecimal

Added in API level 1
void updateBigDecimal (int columnIndex, 
                BigDecimal x)

java.math.BigDecimal值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x BigDecimal: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBigDecimal

Added in API level 1
void updateBigDecimal (String columnLabel, 
                BigDecimal x)

java.sql.BigDecimal值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x BigDecimal: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBinaryStream

Added in API level 1
void updateBinaryStream (int columnIndex, 
                InputStream x, 
                int length)

用二进制流值更新指定列,该值将具有指定的字节数。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x InputStream: the new column value
length int: the length of the stream
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBinaryStream

Added in API level 9
void updateBinaryStream (int columnIndex, 
                InputStream x)

用二进制流值更新指定的列。 数据将根据需要从流中读取,直到达到流结束。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注:请查阅您的JDBC驱动程序文档,以确定使用带有长度参数的 updateBinaryStream版本是否更有效。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x InputStream: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBinaryStream

Added in API level 9
void updateBinaryStream (String columnLabel, 
                InputStream x, 
                long length)

用二进制流值更新指定列,该值将具有指定的字节数。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x InputStream: the new column value
length long: the length of the stream
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBinaryStream

Added in API level 9
void updateBinaryStream (String columnLabel, 
                InputStream x)

用二进制流值更新指定的列。 数据将根据需要从流中读取,直到达到流结束。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注意:请查阅您的JDBC驱动程序文档以确定使用带有长度参数的版本 updateBinaryStream是否更有效。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x InputStream: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBinaryStream

Added in API level 1
void updateBinaryStream (String columnLabel, 
                InputStream x, 
                int length)

用二进制流值更新指定列,该值将具有指定的字节数。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x InputStream: the new column value
length int: the length of the stream
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBinaryStream

Added in API level 9
void updateBinaryStream (int columnIndex, 
                InputStream x, 
                long length)

用二进制流值更新指定列,该值将具有指定的字节数。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x InputStream: the new column value
length long: the length of the stream
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBlob

Added in API level 1
void updateBlob (String columnLabel, 
                Blob x)

java.sql.Blob值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x Blob: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBlob

Added in API level 9
void updateBlob (String columnLabel, 
                InputStream inputStream)

使用给定的输入流更新指定的列。 数据将根据需要从流中读取,直到达到流结束。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注意:请查阅您的JDBC驱动程序文档以确定使用带有长度参数的 updateBlob版本是否更有效。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
inputStream InputStream: An object that contains the data to set the parameter value to.
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBlob

Added in API level 1
void updateBlob (int columnIndex, 
                Blob x)

java.sql.Blob值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Blob: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBlob

Added in API level 9
void updateBlob (String columnLabel, 
                InputStream inputStream, 
                long length)

使用给定的输入流更新指定的列,该输入流将具有指定的字节数。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
inputStream InputStream: An object that contains the data to set the parameter value to.
length long: the number of bytes in the parameter data.
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBlob

Added in API level 9
void updateBlob (int columnIndex, 
                InputStream inputStream)

使用给定的输入流更新指定的列。 数据将根据需要从流中读取,直到达到流结束。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注:请查阅您的JDBC驱动程序文档以确定使用带有长度参数的 updateBlob版本是否更有效。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
inputStream InputStream: An object that contains the data to set the parameter value to.
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBlob

Added in API level 9
void updateBlob (int columnIndex, 
                InputStream inputStream, 
                long length)

使用给定的输入流更新指定的列,该输入流将具有指定的字节数。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
inputStream InputStream: An object that contains the data to set the parameter value to.
length long: the number of bytes in the parameter data.
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBoolean

Added in API level 1
void updateBoolean (String columnLabel, 
                boolean x)

boolean值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x boolean: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBoolean

Added in API level 1
void updateBoolean (int columnIndex, 
                boolean x)

boolean值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x boolean: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateByte

Added in API level 1
void updateByte (int columnIndex, 
                byte x)

byte值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x byte: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateByte

Added in API level 1
void updateByte (String columnLabel, 
                byte x)

byte值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x byte: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBytes

Added in API level 1
void updateBytes (int columnIndex, 
                byte[] x)

byte数组值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x byte: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateBytes

Added in API level 1
void updateBytes (String columnLabel, 
                byte[] x)

用字节数组值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x byte: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateCharacterStream

Added in API level 1
void updateCharacterStream (String columnLabel, 
                Reader reader, 
                int length)

使用字符流值更新指定的列,该值将具有指定的字节数。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
reader Reader: the java.io.Reader object containing the new column value
length int: the length of the stream
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateCharacterStream

Added in API level 9
void updateCharacterStream (String columnLabel, 
                Reader reader, 
                long length)

使用字符流值更新指定的列,该值将具有指定的字节数。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
reader Reader: the java.io.Reader object containing the new column value
length long: the length of the stream
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateCharacterStream

Added in API level 9
void updateCharacterStream (int columnIndex, 
                Reader x, 
                long length)

使用字符流值更新指定的列,该值将具有指定的字节数。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Reader: the new column value
length long: the length of the stream
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateCharacterStream

Added in API level 9
void updateCharacterStream (int columnIndex, 
                Reader x)

用字符流值更新指定的列。 数据将根据需要从流中读取,直到达到流结束。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注意:请查阅您的JDBC驱动程序文档,以确定使用带有长度参数的 updateCharacterStream版本是否更有效。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Reader: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateCharacterStream

Added in API level 1
void updateCharacterStream (int columnIndex, 
                Reader x, 
                int length)

使用字符流值更新指定的列,该值将具有指定的字节数。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Reader: the new column value
length int: the length of the stream
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateCharacterStream

Added in API level 9
void updateCharacterStream (String columnLabel, 
                Reader reader)

用字符流值更新指定的列。 数据将根据需要从流中读取,直到达到流结束。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注意:请查阅您的JDBC驱动程序文档,以确定使用带有长度参数的 updateCharacterStream版本是否更有效。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
reader Reader: the java.io.Reader object containing the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateClob

Added in API level 1
void updateClob (int columnIndex, 
                Clob x)

java.sql.Clob值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Clob: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateClob

Added in API level 9
void updateClob (String columnLabel, 
                Reader reader)

使用给定的Reader对象更新指定的列。 数据将根据需要从流中读取,直到达到流结束。 JDBC驱动程序将执行从UNICODE到数据库字符格式的任何必要转换。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注:请查阅您的JDBC驱动程序文档,以确定使用带有长度参数的版本 updateClob是否更有效。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
reader Reader: An object that contains the data to set the parameter value to.
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateClob

Added in API level 9
void updateClob (String columnLabel, 
                Reader reader, 
                long length)

使用给定的Reader对象更新指定的列,该对象是给定的字符长度。 当一个非常大的UNICODE值输入到LONGVARCHAR参数时,通过java.io.Reader对象发送它可能更实际。 JDBC驱动程序将执行从UNICODE到数据库字符格式的任何必要转换。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
reader Reader: An object that contains the data to set the parameter value to.
length long: the number of characters in the parameter data.
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateClob

Added in API level 9
void updateClob (int columnIndex, 
                Reader reader)

使用给定的Reader对象更新指定的列。 数据将根据需要从流中读取,直到达到流结束。 JDBC驱动程序将执行从UNICODE到数据库字符格式的任何必要转换。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注意:请查阅您的JDBC驱动程序文档以确定使用带有长度参数的 updateClob版本是否更有效。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
reader Reader: An object that contains the data to set the parameter value to.
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateClob

Added in API level 9
void updateClob (int columnIndex, 
                Reader reader, 
                long length)

使用给定的Reader对象更新指定的列,该对象是给定的字符长度。 当一个非常大的UNICODE值输入到LONGVARCHAR参数时,通过java.io.Reader对象发送它可能更实际。 JDBC驱动程序将执行从UNICODE到数据库字符格式的任何必要转换。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
reader Reader: An object that contains the data to set the parameter value to.
length long: the number of characters in the parameter data.
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateClob

Added in API level 1
void updateClob (String columnLabel, 
                Clob x)

java.sql.Clob值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x Clob: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateDate

Added in API level 1
void updateDate (int columnIndex, 
                Date x)

java.sql.Date值更新指定列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Date: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateDate

Added in API level 1
void updateDate (String columnLabel, 
                Date x)

java.sql.Date值更新指定列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x Date: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateDouble

Added in API level 1
void updateDouble (String columnLabel, 
                double x)

double值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x double: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateDouble

Added in API level 1
void updateDouble (int columnIndex, 
                double x)

double值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x double: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateFloat

Added in API level 1
void updateFloat (int columnIndex, 
                float x)

float值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x float: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateFloat

Added in API level 1
void updateFloat (String columnLabel, 
                float x)

float值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x float: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateInt

Added in API level 1
void updateInt (String columnLabel, 
                int x)

int值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x int: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateInt

Added in API level 1
void updateInt (int columnIndex, 
                int x)

int值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x int: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateLong

Added in API level 1
void updateLong (int columnIndex, 
                long x)

long值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x long: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateLong

Added in API level 1
void updateLong (String columnLabel, 
                long x)

long值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x long: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNCharacterStream

Added in API level 9
void updateNCharacterStream (int columnIndex, 
                Reader x, 
                long length)

使用字符流值更新指定的列,该值将具有指定的字节数。 驱动程序将从Java字符格式转换为数据库中的国家字符集。 更新时,它适用于使用NCHARNVARCHARLONGNVARCHAR列。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Reader: the new column value
length long: the length of the stream
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNCharacterStream

Added in API level 9
void updateNCharacterStream (String columnLabel, 
                Reader reader)

用字符流值更新指定的列。 数据将根据需要从流中读取,直到达到流结束。 驱动程序将从Java字符格式转换为数据库中的国家字符集。 更新时,它适用于使用NCHARNVARCHARLONGNVARCHAR列。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注意:请查阅您的JDBC驱动程序文档以确定使用带有长度参数的版本 updateNCharacterStream是否更有效。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
reader Reader: the java.io.Reader object containing the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNCharacterStream

Added in API level 9
void updateNCharacterStream (int columnIndex, 
                Reader x)

用字符流值更新指定的列。 数据将根据需要从流中读取,直到达到流结束。 驱动程序将从Java字符格式转换为数据库中的国家字符集。 更新时,它适用于使用NCHARNVARCHARLONGNVARCHAR列。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注:请查阅您的JDBC驱动程序文档,以确定使用带有长度参数的 updateNCharacterStream版本是否更有效。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Reader: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNCharacterStream

Added in API level 9
void updateNCharacterStream (String columnLabel, 
                Reader reader, 
                long length)

使用字符流值更新指定的列,该值将具有指定的字节数。 驱动程序将从Java字符格式转换为数据库中的国家字符集。 更新时,它适用于使用NCHARNVARCHARLONGNVARCHAR列。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
reader Reader: the java.io.Reader object containing the new column value
length long: the length of the stream
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNClob

Added in API level 9
void updateNClob (int columnIndex, 
                Reader reader, 
                long length)

使用给定的Reader对象更新指定的列,该对象是给定的字符长度。 当一个非常大的UNICODE值输入到LONGVARCHAR参数时,通过java.io.Reader对象发送它可能更实际。 JDBC驱动程序将执行从UNICODE到数据库字符格式的任何必要转换。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second 2, ...
reader Reader: An object that contains the data to set the parameter value to.
length long: the number of characters in the parameter data.
Throws
SQLException if the columnIndex is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; this method is called on a closed result set, if a database access error occurs or the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNClob

Added in API level 9
void updateNClob (int columnIndex, 
                NClob nClob)

java.sql.NClob值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second 2, ...
nClob NClob: the value for the column to be updated
Throws
SQLException if the columnIndex is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; this method is called on a closed result set; if a database access error occurs or the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNClob

Added in API level 9
void updateNClob (String columnLabel, 
                NClob nClob)

java.sql.NClob值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
nClob NClob: the value for the column to be updated
Throws
SQLException if the columnLabel is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; this method is called on a closed result set; if a database access error occurs or the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNClob

Added in API level 9
void updateNClob (String columnLabel, 
                Reader reader)

使用给定的Reader对象更新指定的列。 数据将根据需要从流中读取,直到达到流结束。 JDBC驱动程序将执行从UNICODE到数据库字符格式的任何必要转换。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注:请查阅您的JDBC驱动程序文档以确定使用带有长度参数的 updateNClob版本是否更有效。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
reader Reader: An object that contains the data to set the parameter value to.
Throws
SQLException if the columnLabel is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; this method is called on a closed result set; if a database access error occurs or the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNClob

Added in API level 9
void updateNClob (String columnLabel, 
                Reader reader, 
                long length)

使用给定的Reader对象更新指定的列,该对象是给定的字符长度。 当一个非常大的UNICODE值输入到LONGVARCHAR参数时,通过java.io.Reader对象发送它可能更实用。 JDBC驱动程序将执行从UNICODE到数据库字符格式的任何必要转换。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
reader Reader: An object that contains the data to set the parameter value to.
length long: the number of characters in the parameter data.
Throws
SQLException if the columnLabel is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; this method is called on a closed result set; if a database access error occurs or the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNClob

Added in API level 9
void updateNClob (int columnIndex, 
                Reader reader)

使用给定的Reader更新指定的列根据需要从流中读取数据,直到达到流结束。 JDBC驱动程序将执行从UNICODE到数据库字符格式的任何必要转换。

updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

注:请查阅您的JDBC驱动程序文档,以确定使用带有长度参数的 updateNClob版本是否更有效。

Parameters
columnIndex int: the first column is 1, the second 2, ...
reader Reader: An object that contains the data to set the parameter value to.
Throws
SQLException if the columnIndex is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; this method is called on a closed result set, if a database access error occurs or the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNString

Added in API level 9
void updateNString (String columnLabel, 
                String nString)

String值更新指定的列。 更新时,它适用于使用NCHARNVARCHARLONGNVARCHAR列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
nString String: the value for the column to be updated
Throws
SQLException if the columnLabel is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; this method is called on a closed result set; the result set concurrency is CONCUR_READ_ONLY or if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNString

Added in API level 9
void updateNString (int columnIndex, 
                String nString)

String值更新指定的列。 更新时,它适用于使用NCHARNVARCHARLONGNVARCHAR列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second 2, ...
nString String: the value for the column to be updated
Throws
SQLException if the columnIndex is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; this method is called on a closed result set; the result set concurrency is CONCUR_READ_ONLY or if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNull

Added in API level 1
void updateNull (int columnIndex)

null值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateNull

Added in API level 1
void updateNull (String columnLabel)

null值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateObject

Added in API level 1
void updateObject (int columnIndex, 
                Object x)

Object值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Object: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateObject

Added in API level 1
void updateObject (int columnIndex, 
                Object x, 
                int scaleOrLength)

Object值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

如果第二个参数是InputStream那么该流必须包含scaleOrLength指定的字节数。 如果第二个参数是Reader那么阅读器必须包含scaleOrLength指定的字符数。 如果这些条件不成立,驱动程序将在语句执行时生成SQLException

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Object: the new column value
scaleOrLength int: for an object of java.math.BigDecimal , this is the number of digits after the decimal point. For Java Object types InputStream and Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateObject

Added in API level 1
void updateObject (String columnLabel, 
                Object x, 
                int scaleOrLength)

Object值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

如果第二个参数是InputStream那么该流必须包含scaleOrLength指定的字节数。 如果第二个参数是Reader则阅读器必须包含scaleOrLength指定的字符数。 如果这些条件不成立,驱动程序将在语句执行时生成一个SQLException

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x Object: the new column value
scaleOrLength int: for an object of java.math.BigDecimal , this is the number of digits after the decimal point. For Java Object types InputStream and Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateObject

Added in API level 1
void updateObject (String columnLabel, 
                Object x)

Object值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x Object: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateRef

Added in API level 1
void updateRef (int columnIndex, 
                Ref x)

java.sql.Ref值更新指定列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Ref: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateRef

Added in API level 1
void updateRef (String columnLabel, 
                Ref x)

java.sql.Ref值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x Ref: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateRow

Added in API level 1
void updateRow ()

使用此ResultSet对象的当前行的新内容更新底层数据库。 当光标位于插入行上时,不能调用此方法。

Throws
SQLException if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY; this method is called on a closed result set or if this method is called when the cursor is on the insert row
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateRowId

Added in API level 9
void updateRowId (int columnIndex, 
                RowId x)

RowId值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second 2, ...
x RowId: the column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateRowId

Added in API level 9
void updateRowId (String columnLabel, 
                RowId x)

RowId值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x RowId: the column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateSQLXML

Added in API level 9
void updateSQLXML (int columnIndex, 
                SQLXML xmlObject)

java.sql.SQLXML值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second 2, ...
xmlObject SQLXML: the value for the column to be updated
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; this method is called on a closed result set; the java.xml.transform.Result, Writer or OutputStream has not been closed for the SQLXML object; if there is an error processing the XML value or the result set concurrency is CONCUR_READ_ONLY. The getCause method of the exception may provide a more detailed exception, for example, if the stream does not contain valid XML.
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateSQLXML

Added in API level 9
void updateSQLXML (String columnLabel, 
                SQLXML xmlObject)

java.sql.SQLXML值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
xmlObject SQLXML: the column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; this method is called on a closed result set; the java.xml.transform.Result, Writer or OutputStream has not been closed for the SQLXML object; if there is an error processing the XML value or the result set concurrency is CONCUR_READ_ONLY. The getCause method of the exception may provide a more detailed exception, for example, if the stream does not contain valid XML.
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateShort

Added in API level 1
void updateShort (String columnLabel, 
                short x)

short值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x short: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateShort

Added in API level 1
void updateShort (int columnIndex, 
                short x)

short值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x short: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateString

Added in API level 1
void updateString (String columnLabel, 
                String x)

String值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x String: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateString

Added in API level 1
void updateString (int columnIndex, 
                String x)

String值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x String: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateTime

Added in API level 1
void updateTime (int columnIndex, 
                Time x)

java.sql.Time值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Time: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateTime

Added in API level 1
void updateTime (String columnLabel, 
                Time x)

java.sql.Time值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x Time: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateTimestamp

Added in API level 1
void updateTimestamp (String columnLabel, 
                Timestamp x)

java.sql.Timestamp值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnLabel String: the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column
x Timestamp: the new column value
Throws
SQLException if the columnLabel is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

updateTimestamp

Added in API level 1
void updateTimestamp (int columnIndex, 
                Timestamp x)

java.sql.Timestamp值更新指定的列。 updater方法用于更新当前行或插入行中的列值。 updater方法不会更新底层数据库; 而是updateRowinsertRow方法来更新数据库。

Parameters
columnIndex int: the first column is 1, the second is 2, ...
x Timestamp: the new column value
Throws
SQLException if the columnIndex is not valid; if a database access error occurs; the result set concurrency is CONCUR_READ_ONLY or this method is called on a closed result set
SQLFeatureNotSupportedException if the JDBC driver does not support this method

wasNull

Added in API level 1
boolean wasNull ()

报告最后一列的读取值是否为SQL NULL 请注意,您必须首先调用列上的某个getter方法以尝试读取其值,然后调用方法wasNull以查看读取的值是否为SQL NULL

Returns
boolean true if the last column value read was SQL NULL and false otherwise
Throws
SQLException if a database access error occurs or this method is called on a closed result set

Hooray!