
ResultSet provides access to a table of data generated by executing a Statement. The table rows are retrieved in sequence. Within a row its column values can be accessed in any order.
A ResultSet maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The 'next' method moves the cursor to the next row.
The getXXX methods retrieve column values for the current row. You can retrieve values either using the index number of the column, or by using the name of the column. In general using the column index will be more efficient. Columns are numbered from 1.
For maximum portability, ResultSet columns within each row should be read in left-to-right order and each column should be read only once.
For the getXXX methods, the JDBC driver attempts to convert the underlying data to the specified Java type and returns a suitable Java value. See the JDBC specification for allowable mappings from SQL types to Java types with the ResultSet getXXX methods.
Column names used as input to getXXX methods are case insenstive. When performing a getXXX using a column name, if several columns have the same name, then the value of the first matching column will be returned. The column name option is designed to be used when column names are used in the SQL Query. For columns that are NOT explicitly named in the query, it is best to use column numbers. If column names were used there is no way for the programmer to guarentee that they actually refer to the intended columns.
A ResultSet is automatically closed by the Statement that generated it when that Statement is closed, re-executed, or is used to retrieve the next result from a sequence of multiple results.
The number, types and properties of a ResultSet's columns are provided by the ResultSetMetaData object returned by the getMetaData method.
java.sql.ResultSet
DriverResultSet.java の 91 行で定義されています。
Public メソッド | |
| boolean | next () throws java.sql.SQLException |
| boolean | prev () throws SQLException |
| boolean | isBeforeFirst () throws SQLException |
| boolean | isAfterLast () throws SQLException |
| boolean | isFirst () throws SQLException |
| boolean | isLast () throws SQLException |
| void | beforeFirst () throws SQLException |
| void | afterLast () throws SQLException |
| boolean | first () throws SQLException |
| boolean | last () throws SQLException |
| int | getRow () throws SQLException |
| boolean | absolute (int row) throws SQLException |
| boolean | relative (int rows) throws SQLException |
| boolean | previous () throws SQLException |
| void | setFetchDirection (int direction) throws SQLException |
| int | getFetchDirection () throws SQLException |
| void | setFetchSize (int rows) throws SQLException |
| int | getFetchSize () throws SQLException |
| String | getString (int columnIndex) throws SQLException |
| boolean | getBoolean (int columnIndex) throws SQLException |
| short | getShort (int columnIndex) throws SQLException |
| int | getInt (int columnIndex) throws SQLException |
| long | getLong (int columnIndex) throws SQLException |
| float | getFloat (int columnIndex) throws SQLException |
| double | getDouble (int columnIndex) throws SQLException |
| BigDecimal | getBigDecimal (int columnIndex, int scale) throws SQLException |
| byte[] | getBytes (int columnIndex) throws SQLException |
| java.sql.Date | getDate (int columnIndex) throws SQLException |
| Time | getTime (int columnIndex) throws SQLException |
| Timestamp | getTimestamp (int columnIndex) throws SQLException |
| InputStream | getAsciiStream (int columnIndex) throws SQLException |
| InputStream | getUnicodeStream (int columnIndex) throws SQLException |
| InputStream | getBinaryStream (int columnIndex) throws SQLException |
| String | getString (String columnName) throws SQLException |
| boolean | getBoolean (String columnName) throws SQLException |
| byte | getByte (String columnName) throws SQLException |
| short | getShort (String columnName) throws SQLException |
| int | getInt (String columnName) throws SQLException |
| long | getLong (String columnName) throws SQLException |
| float | getFloat (String columnName) throws SQLException |
| double | getDouble (String columnName) throws SQLException |
| BigDecimal | getBigDecimal (String columnName, int scale) throws SQLException |
| byte[] | getBytes (String columnName) throws SQLException |
| java.sql.Date | getDate (String columnName) throws SQLException |
| Time | getTime (String columnName) throws SQLException |
| Timestamp | getTimestamp (String columnName) throws SQLException |
| InputStream | getAsciiStream (String columnName) throws SQLException |
| InputStream | getUnicodeStream (String columnName) throws SQLException |
| InputStream | getBinaryStream (String columnName) throws SQLException |
| java.sql.SQLWarning | getWarnings () throws SQLException |
| void | clearWarnings () throws SQLException |
| String | getCursorName () throws SQLException |
| Object | getObject (int columnIndex) throws SQLException |
| Object | getObject (String columnName) throws SQLException |
| java.io.Reader | getCharacterStream (int columnIndex) throws SQLException |
| java.io.Reader | getCharacterStream (String columnName) throws SQLException |
| BigDecimal | getBigDecimal (int columnIndex) throws SQLException |
| BigDecimal | getBigDecimal (String columnName) throws SQLException |
| Object | getObject (int i, java.util.Map map) throws SQLException |
| java.sql.Ref | getRef (int i) throws SQLException |
| java.sql.Blob | getBlob (int columnIndex) throws SQLException |
| java.sql.Clob | getClob (int columnIndex) throws SQLException |
| java.sql.Array | getArray (int columnIndex) throws SQLException |
| Object | getObject (String colName, java.util.Map map) throws SQLException |
| java.sql.Ref | getRef (String colName) throws SQLException |
| java.sql.Blob | getBlob (String colName) throws SQLException |
| java.sql.Clob | getClob (String colName) throws SQLException |
| java.sql.Array | getArray (String colName) throws SQLException |
| java.sql.Date | getDate (int columnIndex, Calendar cal) throws SQLException |
| java.sql.Date | getDate (String columnName, Calendar cal) throws SQLException |
| java.sql.Time | getTime (int columnIndex, Calendar cal) throws SQLException |
| java.sql.Time | getTime (String columnName, Calendar cal) throws SQLException |
| java.sql.Timestamp | getTimestamp (int columnIndex, Calendar cal) throws SQLException |
| java.sql.Timestamp | getTimestamp (String columnName, Calendar cal) throws SQLException |
| boolean | rowUpdated () throws SQLException |
| boolean | rowInserted () throws SQLException |
| boolean | rowDeleted () throws SQLException |
| void | updateNull (int columnIndex) throws SQLException |
| void | updateBoolean (int columnIndex, boolean x) throws SQLException |
| void | updateByte (int columnIndex, byte x) throws SQLException |
| void | updateShort (int columnIndex, short x) throws SQLException |
| void | updateInt (int columnIndex, int x) throws SQLException |
| void | updateLong (int columnIndex, long x) throws SQLException |
| void | updateFloat (int columnIndex, float x) throws SQLException |
| void | updateDouble (int columnIndex, double x) throws SQLException |
| void | updateBigDecimal (int columnIndex, BigDecimal x) throws SQLException |
| void | updateString (int columnIndex, String x) throws SQLException |
| void | updateBytes (int columnIndex, byte x[]) throws SQLException |
| void | updateDate (int columnIndex, java.sql.Date x) throws SQLException |
| void | updateTime (int columnIndex, java.sql.Time x) throws SQLException |
| void | updateTimestamp (int columnIndex, java.sql.Timestamp x) throws SQLException |
| void | updateAsciiStream (int columnIndex, java.io.InputStream x, int length) throws SQLException |
| void | updateBinaryStream (int columnIndex, java.io.InputStream x, int length) throws SQLException |
| void | updateCharacterStream (int columnIndex, java.io.Reader x, int length) throws SQLException |
| void | updateObject (int columnIndex, Object x, int scale) throws SQLException |
| void | updateObject (int columnIndex, Object x) throws SQLException |
| void | updateNull (String columnName) throws SQLException |
| void | updateBoolean (String columnName, boolean x) throws SQLException |
| void | updateByte (String columnName, byte x) throws SQLException |
| void | updateShort (String columnName, short x) throws SQLException |
| void | updateInt (String columnName, int x) throws SQLException |
| void | updateLong (String columnName, long x) throws SQLException |
| void | updateFloat (String columnName, float x) throws SQLException |
| void | updateDouble (String columnName, double x) throws SQLException |
| void | updateBigDecimal (String columnName, BigDecimal x) throws SQLException |
| void | updateString (String columnName, String x) throws SQLException |
| void | updateBytes (String columnName, byte x[]) throws SQLException |
| void | updateDate (String columnName, java.sql.Date x) throws SQLException |
| void | updateTime (String columnName, java.sql.Time x) throws SQLException |
| void | updateTimestamp (String columnName, java.sql.Timestamp x) throws SQLException |
| void | updateAsciiStream (String columnName, java.io.InputStream x, int length) throws SQLException |
| void | updateBinaryStream (String columnName, java.io.InputStream x, int length) throws SQLException |
| void | updateCharacterStream (String columnName, java.io.Reader reader, int length) throws SQLException |
| void | updateObject (String columnName, Object x, int scale) throws SQLException |
| void | updateObject (String columnName, Object x) throws SQLException |
| void | insertRow () throws SQLException |
| void | updateRow () throws SQLException |
| void | deleteRow () throws SQLException |
| void | refreshRow () throws SQLException |
| void | cancelRowUpdates () throws SQLException |
| void | moveToInsertRow () throws SQLException |
| void | moveToCurrentRow () throws SQLException |
| int | getType () throws SQLException |
| int | getConcurrency () throws SQLException |
| void | close () throws SQLException |
| boolean | wasNull () throws SQLException |
| java.sql.Statement | getStatement () throws SQLException |
| java.sql.ResultSetMetaData | getMetaData () throws SQLException |
| int | findColumn (String columnName) throws SQLException |
| DriverResultSet (Field[] fields, ArrayList resultData) | |
| DriverResultSet (Field[] fields, ArrayList resultData, boolean crsHasMoreData, String cursorName) | |
| java.net.URL | getURL (int columnIndex) throws SQLException |
| java.net.URL | getURL (String columnName) throws SQLException |
| void | updateRef (int columnIndex, java.sql.Ref x) throws SQLException |
| void | updateRef (String columnName, java.sql.Ref x) throws SQLException |
| void | updateBlob (int columnIndex, java.sql.Blob x) throws SQLException |
| void | updateBlob (String columnName, java.sql.Blob x) throws SQLException |
| void | updateClob (int columnIndex, java.sql.Clob x) throws SQLException |
| void | updateClob (String columnName, java.sql.Clob x) throws SQLException |
| void | updateArray (int columnIndex, java.sql.Array x) throws SQLException |
| void | updateArray (String columnName, java.sql.Array x) throws SQLException |
| byte | getByte (int columnIndex) throws SQLException |
Protected メソッド | |
| void | setResultSetType (int typeFlag) |
| void | setResultSetConcurrency (int concurrencyFlag) |
| void | setData (ArrayList newData) |
| void | setHasMoreData (boolean hasMore) |
| void | setStatement (Statement stmt) throws SQLException |
Protected 変数 | |
| int | currentRow = -1 |
| int | nbOfRows = -1 |
| int | nbOfColumns = -1 |
| ArrayList | data |
| int | fetchDirection = FETCH_FORWARD |
| int | fetchSize = 0 |
| Field[] | fields |
| boolean | wasNullFlag = false |
| transient Hashtable | columnNameToIndex = null |
| transient Hashtable | fullColumnNameToIndex = null |
| int | resultSetType = 0 |
| int | resultSetConcurrency = 0 |
| SQLWarning | warnings = null |
| transient Statement | owningStatement |
Private メソッド | |
| void | buildIndexMapping () |
| void | checkRowAndColPosAndSetNullFlag (int columnIndex) throws SQLException |
| void | checkIfClosed () throws SQLException |
Private 変数 | |
| boolean | hasMoreData |
| String | cursorName |
| boolean | isClosed = true |
Static Private 変数 | |
| final String | UPDATEABLE_MESSAGE |
|
||||||||||||
|
Creates a new
参照先 org.objectweb.cjdbc.driver.DriverResultSet.currentRow, org.objectweb.cjdbc.driver.DriverResultSet.data, org.objectweb.cjdbc.driver.DriverResultSet.isClosed, org.objectweb.cjdbc.driver.DriverResultSet.nbOfColumns, と org.objectweb.cjdbc.driver.DriverResultSet.nbOfRows.
|
|
||||||||||||||||||||
|
Creates a new
参照先 org.objectweb.cjdbc.driver.DriverResultSet.hasMoreData.
|
|
|
JDBC 2.0 Move to an absolute row number in the result set. If row is positive, moves to an absolute row with respect to the beginning of the result set. The first row is row 1, the second is row 2, etc. If row is negative, moves to an absolute row position with respect to the end of result set. For example, calling absolute(-1) positions the cursor on the last row, absolute(-2) indicates the next-to-last row, etc. An attempt to position the cursor beyond the first/last row in the result set, leaves the cursor before/after the first/last row, respectively. Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().
参照先 org.objectweb.cjdbc.driver.DriverResultSet.afterLast(), org.objectweb.cjdbc.driver.DriverResultSet.beforeFirst(), org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, org.objectweb.cjdbc.driver.DriverResultSet.first(), org.objectweb.cjdbc.driver.DriverResultSet.last(), と org.objectweb.cjdbc.driver.DriverResultSet.nbOfRows. 参照元 org.objectweb.cjdbc.driver.DriverResultSet.relative().
|
|
|
JDBC 2.0 Moves to the end of the result set, just after the last row. Has no effect if the result set contains no rows.
参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, と org.objectweb.cjdbc.driver.DriverResultSet.nbOfRows. 参照元 org.objectweb.cjdbc.driver.DriverResultSet.absolute().
|
|
|
JDBC 2.0 Moves to the front of the result set, just before the first row. Has no effect if the result set contains no rows.
参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed(), と org.objectweb.cjdbc.driver.DriverResultSet.currentRow. 参照元 org.objectweb.cjdbc.driver.DriverResultSet.absolute().
|
|
|
Builds a hash between column names and their indices for fast retrieval. DriverResultSet.java の 2457 行で定義されています。 参照先 org.objectweb.cjdbc.driver.DriverResultSet.columnNameToIndex, org.objectweb.cjdbc.driver.DriverResultSet.fields, org.objectweb.cjdbc.driver.DriverResultSet.fullColumnNameToIndex, org.objectweb.cjdbc.driver.Field.getFieldName(), と org.objectweb.cjdbc.driver.DriverResultSet.nbOfColumns. 参照元 org.objectweb.cjdbc.driver.DriverResultSet.findColumn().
|
|
|
JDBC 2.0 The cancelRowUpdates() method may be called after calling an updateXXX() method(s) and before calling updateRow() to rollback the updates made to a row. If no updates have been made or updateRow() has already been called, then this method has no effect.
|
|
|
|
Sanity checks for result parsing
参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, org.objectweb.cjdbc.driver.DriverResultSet.data, org.objectweb.cjdbc.driver.DriverResultSet.fields, org.objectweb.cjdbc.driver.DriverResultSet.nbOfColumns, org.objectweb.cjdbc.driver.DriverResultSet.nbOfRows, と org.objectweb.cjdbc.driver.DriverResultSet.wasNullFlag. 参照元 org.objectweb.cjdbc.driver.DriverResultSet.getArray(), org.objectweb.cjdbc.driver.DriverResultSet.getAsciiStream(), org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal(), org.objectweb.cjdbc.driver.DriverResultSet.getBinaryStream(), org.objectweb.cjdbc.driver.DriverResultSet.getBoolean(), org.objectweb.cjdbc.driver.DriverResultSet.getByte(), org.objectweb.cjdbc.driver.DriverResultSet.getBytes(), org.objectweb.cjdbc.driver.DriverResultSet.getClob(), org.objectweb.cjdbc.driver.DriverResultSet.getDate(), org.objectweb.cjdbc.driver.DriverResultSet.getDouble(), org.objectweb.cjdbc.driver.DriverResultSet.getFloat(), org.objectweb.cjdbc.driver.DriverResultSet.getInt(), org.objectweb.cjdbc.driver.DriverResultSet.getLong(), org.objectweb.cjdbc.driver.DriverResultSet.getObject(), org.objectweb.cjdbc.driver.DriverResultSet.getShort(), org.objectweb.cjdbc.driver.DriverResultSet.getString(), org.objectweb.cjdbc.driver.DriverResultSet.getTime(), org.objectweb.cjdbc.driver.DriverResultSet.getTimestamp(), と org.objectweb.cjdbc.driver.DriverResultSet.getUnicodeStream().
|
|
|
After this call, getWarnings returns null until a new warning is reported for this ResultSet
参照先 org.objectweb.cjdbc.driver.DriverResultSet.warnings. 参照元 org.objectweb.cjdbc.driver.DriverResultSet.next().
|
|
|
Closes the remote ResultSet if the ResultSet was streamed else just closes the ResultSet locally.
参照先 org.objectweb.cjdbc.driver.Connection.closeRemoteResultSet(), org.objectweb.cjdbc.driver.Statement.connection, org.objectweb.cjdbc.driver.DriverResultSet.cursorName, org.objectweb.cjdbc.driver.DriverResultSet.hasMoreData, org.objectweb.cjdbc.driver.DriverResultSet.isClosed, と org.objectweb.cjdbc.driver.DriverResultSet.owningStatement.
|
|
|
JDBC 2.0 Delete the current row from the result set and the underlying database. Cannot be called when on the insert row.
|
|
|
Map a
参照先 org.objectweb.cjdbc.driver.DriverResultSet.buildIndexMapping(), org.objectweb.cjdbc.driver.DriverResultSet.columnNameToIndex, org.objectweb.cjdbc.driver.DriverResultSet.fields, org.objectweb.cjdbc.driver.DriverResultSet.fullColumnNameToIndex, org.objectweb.cjdbc.driver.Field.getFieldName(), org.objectweb.cjdbc.driver.Field.getFullName(), と org.objectweb.cjdbc.driver.DriverResultSet.nbOfColumns. 参照元 org.objectweb.cjdbc.driver.DriverResultSet.getArray(), org.objectweb.cjdbc.driver.DriverResultSet.getAsciiStream(), org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal(), org.objectweb.cjdbc.driver.DriverResultSet.getBinaryStream(), org.objectweb.cjdbc.driver.DriverResultSet.getBlob(), org.objectweb.cjdbc.driver.DriverResultSet.getBoolean(), org.objectweb.cjdbc.driver.DriverResultSet.getByte(), org.objectweb.cjdbc.driver.DriverResultSet.getBytes(), org.objectweb.cjdbc.driver.DriverResultSet.getClob(), org.objectweb.cjdbc.driver.DriverResultSet.getDate(), org.objectweb.cjdbc.driver.DriverResultSet.getDouble(), org.objectweb.cjdbc.driver.DriverResultSet.getFloat(), org.objectweb.cjdbc.driver.DriverResultSet.getInt(), org.objectweb.cjdbc.driver.DriverResultSet.getLong(), org.objectweb.cjdbc.driver.DriverResultSet.getObject(), org.objectweb.cjdbc.driver.DriverResultSet.getShort(), org.objectweb.cjdbc.driver.DriverResultSet.getString(), org.objectweb.cjdbc.driver.DriverResultSet.getTime(), org.objectweb.cjdbc.driver.DriverResultSet.getTimestamp(), と org.objectweb.cjdbc.driver.DriverResultSet.getUnicodeStream().
|
|
|
JDBC 2.0 Moves to the first row in the result set.
参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkIfClosed(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, と org.objectweb.cjdbc.driver.DriverResultSet.nbOfRows. 参照元 org.objectweb.cjdbc.driver.DriverResultSet.absolute().
|
|
|
JDBC 2.0 Get an array column.
参照先 org.objectweb.cjdbc.driver.DriverResultSet.findColumn(), と org.objectweb.cjdbc.driver.DriverResultSet.getArray().
|
|
|
JDBC 2.0 Gets an array column.
参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkRowAndColPosAndSetNullFlag(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, org.objectweb.cjdbc.driver.DriverResultSet.data, と org.objectweb.cjdbc.driver.DriverResultSet.wasNullFlag. 参照元 org.objectweb.cjdbc.driver.DriverResultSet.getArray().
|
|
|
参照先 org.objectweb.cjdbc.driver.DriverResultSet.findColumn(), と org.objectweb.cjdbc.driver.DriverResultSet.getAsciiStream().
|
|
|
A column value can be retrieved as a stream of ASCII characters and then read in chunks from the stream. This method is particulary suitable for retrieving large LONGVARCHAR values. The JDBC driver will do any necessary conversion from the database format into ASCII. Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream. Also, a stream may return 0 for available() whether there is data available or not.
参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkRowAndColPosAndSetNullFlag(), と org.objectweb.cjdbc.driver.DriverResultSet.getBinaryStream(). 参照元 org.objectweb.cjdbc.driver.DriverResultSet.getAsciiStream().
|
|
|
参照先 org.objectweb.cjdbc.driver.DriverResultSet.findColumn(), と org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal().
|
|
|
JDBC 2.0 Get the value of a column in the current row as a java.math.BigDecimal object.
参照先 org.objectweb.cjdbc.driver.DriverResultSet.checkRowAndColPosAndSetNullFlag(), org.objectweb.cjdbc.driver.DriverResultSet.currentRow, org.objectweb.cjdbc.driver.DriverResultSet.data, と org.objectweb.cjdbc.driver.DriverResultSet.wasNullFlag.
|
|
||||||||||||
|
参照先 org.objectweb.cjdbc.driver.DriverResultSet.findColumn(), と org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal().
|
|
||||||||||||
|
Get the value of a column in the current row as a java.lang.BigDecimal object
参照元 org.objectweb.cjdbc.driver.DriverResultSet.getBigDecimal().
|
|
|
|