|
|||||||||
| Home >> All >> com >> mysql >> [ jdbc overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.mysql.jdbc
Class ResultSet

java.lang.Objectcom.mysql.jdbc.ResultSet
- All Implemented Interfaces:
- java.sql.ResultSet
- Direct Known Subclasses:
- UpdatableResultSet
- public class ResultSet
- extends java.lang.Object
- implements java.sql.ResultSet
- extends java.lang.Object
A 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.
- Version:
- $Id: ResultSet.java,v 1.18.2.35 2004/11/05 16:57:46 mmatthew Exp $
| Field Summary | |
protected java.lang.String |
catalog
The catalog that was in use when we were created |
protected java.util.Map |
columnNameToIndex
Map column names (and all of their permutations) to column indices |
protected Connection |
connection
The Connection instance that created us |
protected int |
currentRow
The current row #, -1 == before start of result set |
private java.util.TimeZone |
defaultTimeZone
This method ends up being staticly synchronized, so just store our own copy.... |
protected boolean |
doingUpdates
Are we in the middle of doing updates to the current row? |
private java.util.Calendar |
fastDateCal
|
protected int |
fetchDirection
The direction to fetch rows (always FETCH_FORWARD) |
protected int |
fetchSize
The number of rows to fetch in one go... |
protected Field[] |
fields
The fields for this result set |
protected char |
firstCharOfQuery
First character of the query that created this result set...Used to determine whether or not to parse server info messages in certain circumstances. |
protected java.util.Map |
fullColumnNameToIndex
Map of fully-specified column names to column indices |
private boolean |
hasBuiltIndexMapping
|
protected boolean |
isClosed
Has this result set been closed? |
protected boolean |
onInsertRow
Are we on the insert row? |
protected Statement |
owningStatement
The statement that created us |
protected boolean |
reallyResult
Do we actually contain rows, or just information about UPDATE/INSERT/DELETE? |
protected int |
resultSetConcurrency
Are we read-only or updatable? |
protected int |
resultSetType
Are we scroll-sensitive/insensitive? |
protected RowData |
rowData
The actual rows |
protected java.lang.String |
serverInfo
Any info message from the server that was created while generating this result set (if 'info parsing' is enabled for the connection). |
protected byte[][] |
thisRow
Pointer to current row data |
protected long |
updateCount
How many rows were affected by UPDATE/INSERT/DELETE? |
protected long |
updateId
Value generated for AUTO_INCREMENT columns |
private boolean |
useStrictFloatingPoint
|
protected java.sql.SQLWarning |
warningChain
The warning chain |
protected boolean |
wasNullFlag
Did the previous value retrieval find a NULL? |
| Fields inherited from interface java.sql.ResultSet |
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE |
| Constructor Summary | |
ResultSet(Field[] fields,
RowData tuples)
Creates a new ResultSet object. |
|
ResultSet(long updateCount,
long updateID)
Create a result set for an executeUpdate statement. |
|
ResultSet(java.lang.String catalog,
Field[] fields,
RowData tuples,
Connection conn)
Create a new ResultSet |
|
| Method Summary | |
boolean |
absolute(int row)
JDBC 2.0 |
void |
afterLast()
JDBC 2.0 |
void |
beforeFirst()
JDBC 2.0 |
protected void |
buildIndexMapping()
Builds a hash between column names and their indices for fast retrieval. |
void |
cancelRowUpdates()
JDBC 2.0 The cancelRowUpdates() method may be called after calling an updateXXX() method(s) and before calling updateRow() to rollback the updates made to a row. |
protected void |
checkClosed()
Ensures that the result set is not closed |
protected void |
checkRowPos()
Ensures that the cursor is positioned on a valid row and that the result set is not closed |
void |
clearWarnings()
After this call, getWarnings returns null until a new warning is reported for this ResultSet |
void |
close()
In some cases, it is desirable to immediately release a ResultSet database and JDBC resources instead of waiting for this to happen when it is automatically closed. |
void |
deleteRow()
JDBC 2.0 Delete the current row from the result set and the underlying database. |
private java.sql.Date |
fastDateCreate(java.util.Calendar cal,
int year,
int month,
int day)
|
private java.sql.Time |
fastTimeCreate(java.util.Calendar cal,
int hour,
int minute,
int second)
|
private java.sql.Timestamp |
fastTimestampCreate(java.util.Calendar cal,
int year,
int month,
int day,
int hour,
int minute,
int seconds,
int secondsPart)
|
int |
findColumn(java.lang.String columnName)
Map a ResultSet column name to a ResultSet column index |
boolean |
first()
JDBC 2.0 |
java.sql.Array |
getArray(int i)
JDBC 2.0 Get an array column. |
java.sql.Array |
getArray(java.lang.String colName)
JDBC 2.0 Get an array column. |
java.io.InputStream |
getAsciiStream(int columnIndex)
A column value can be retrieved as a stream of ASCII characters and then read in chunks from the stream. |
java.io.InputStream |
getAsciiStream(java.lang.String columnName)
DOCUMENT ME! |
java.math.BigDecimal |
getBigDecimal(int columnIndex)
JDBC 2.0 Get the value of a column in the current row as a java.math.BigDecimal object. |
java.math.BigDecimal |
getBigDecimal(int columnIndex,
int scale)
Get the value of a column in the current row as a java.math.BigDecimal object |
java.math.BigDecimal |
getBigDecimal(java.lang.String columnName)
JDBC 2.0 Get the value of a column in the current row as a java.math.BigDecimal object. |
java.math.BigDecimal |
getBigDecimal(java.lang.String columnName,
int scale)
DOCUMENT ME! |
java.io.InputStream |
getBinaryStream(int columnIndex)
A column value can also be retrieved as a binary strea. |
java.io.InputStream |
getBinaryStream(java.lang.String columnName)
DOCUMENT ME! |
java.sql.Blob |
getBlob(int columnIndex)
JDBC 2.0 Get a BLOB column. |
java.sql.Blob |
getBlob(java.lang.String colName)
JDBC 2.0 Get a BLOB column. |
boolean |
getBoolean(int columnIndex)
Get the value of a column in the current row as a Java boolean |
boolean |
getBoolean(java.lang.String columnName)
DOCUMENT ME! |
byte |
getByte(int columnIndex)
Get the value of a column in the current row as a Java byte. |
byte |
getByte(java.lang.String columnName)
DOCUMENT ME! |
byte[] |
getBytes(int columnIndex)
Get the value of a column in the current row as a Java byte array. |
byte[] |
getBytes(java.lang.String columnName)
DOCUMENT ME! |
java.io.Reader |
getCharacterStream(int columnIndex)
JDBC 2.0 |
java.io.Reader |
getCharacterStream(java.lang.String columnName)
JDBC 2.0 |
java.sql.Clob |
getClob(int i)
JDBC 2.0 Get a CLOB column. |
java.sql.Clob |
getClob(java.lang.String colName)
JDBC 2.0 Get a CLOB column. |
int |
getConcurrency()
JDBC 2.0 Return the concurrency of this result set. |
java.lang.String |
getCursorName()
Get the name of the SQL cursor used by this ResultSet |
java.sql.Date |
getDate(int columnIndex)
Get the value of a column in the current row as a java.sql.Date object |
java.sql.Date |
getDate(int columnIndex,
java.util.Calendar cal)
JDBC 2.0 Get the value of a column in the current row as a java.sql.Date object. |
java.sql.Date |
getDate(java.lang.String columnName)
DOCUMENT ME! |
java.sql.Date |
getDate(java.lang.String columnName,
java.util.Calendar cal)
Get the value of a column in the current row as a java.sql.Date object. |
double |
getDouble(int columnIndex)
Get the value of a column in the current row as a Java double. |
double |
getDouble(java.lang.String columnName)
DOCUMENT ME! |
protected double |
getDoubleInternal(int colIndex)
Converts a string representation of a number to a double. |
int |
getFetchDirection()
JDBC 2.0 Returns the fetch direction for this result set. |
int |
getFetchSize()
JDBC 2.0 Return the fetch size for this result set. |
protected char |
getFirstCharOfQuery()
Returns the first character of the query that this result set was created from. |
float |
getFloat(int columnIndex)
Get the value of a column in the current row as a Java float. |
float |
getFloat(java.lang.String columnName)
DOCUMENT ME! |
int |
getInt(int columnIndex)
Get the value of a column in the current row as a Java int. |
int |
getInt(java.lang.String columnName)
DOCUMENT ME! |
long |
getLong(int columnIndex)
Get the value of a column in the current row as a Java long. |
long |
getLong(java.lang.String columnName)
DOCUMENT ME! |
java.sql.ResultSetMetaData |
getMetaData()
The numbers, types and properties of a ResultSet's columns are provided by the getMetaData method |
java.lang.Object |
getObject(int columnIndex)
Get the value of a column in the current row as a Java object |
java.lang.Object |
getObject(int i,
java.util.Map map)
JDBC 2.0 Returns the value of column i as a Java object. |
java.lang.Object |
getObject(java.lang.String columnName)
Get the value of a column in the current row as a Java object |
java.lang.Object |
getObject(java.lang.String colName,
java.util.Map map)
JDBC 2.0 Returns the value of column i as a Java object. |
java.sql.Ref |
getRef(int i)
JDBC 2.0 Get a REF(<structured-type>) column. |
java.sql.Ref |
getRef(java.lang.String colName)
JDBC 2.0 Get a REF(<structured-type>) column. |
int |
getRow()
JDBC 2.0 |
protected java.lang.String |
getServerInfo()
Returns the server info (if any), or null if none. |
short |
getShort(int columnIndex)
Get the value of a column in the current row as a Java short. |
short |
getShort(java.lang.String columnName)
DOCUMENT ME! |
java.sql.Statement |
getStatement()
JDBC 2.0 Return the Statement that produced the ResultSet. |
java.lang.String |
getString(int columnIndex)
Get the value of a column in the current row as a Java String |
java.lang.String |
getString(java.lang.String columnName)
The following routines simply convert the columnName into a columnIndex and then call the appropriate routine above. |
java.sql.Time |
getTime(int columnIndex)
Get the value of a column in the current row as a java.sql.Time object |
java.sql.Time |
getTime(int columnIndex,
java.util.Calendar cal)
Get the value of a column in the current row as a java.sql.Time object. |
java.sql.Time |
getTime(java.lang.String columnName)
Get the value of a column in the current row as a java.sql.Time object. |
java.sql.Time |
getTime(java.lang.String columnName,
java.util.Calendar cal)
Get the value of a column in the current row as a java.sql.Time object. |
private java.sql.Time |
getTimeInternal(int columnIndex,
java.util.TimeZone tz)
Get the value of a column in the current row as a java.sql.Time object in the given timezone |
java.sql.Timestamp |
getTimestamp(int columnIndex)
Get the value of a column in the current row as a java.sql.Timestamp object |
java.sql.Timestamp |
getTimestamp(int columnIndex,
java.util.Calendar cal)
Get the value of a column in the current row as a java.sql.Timestamp object. |
java.sql.Timestamp |
getTimestamp(java.lang.String columnName)
DOCUMENT ME! |
java.sql.Timestamp |
getTimestamp(java.lang.String columnName,
java.util.Calendar cal)
Get the value of a column in the current row as a java.sql.Timestamp object. |
private java.sql.Timestamp |
getTimestampInternal(int columnIndex,
java.util.TimeZone tz)
Get the value of a column in the current row as a java.sql.Timestamp object in the given timezone |
int |
getType()
JDBC 2.0 Return the type of this result set. |
java.io.InputStream |
getUnicodeStream(int columnIndex)
A column value can also be retrieved as a stream of Unicode characters. |
java.io.InputStream |
getUnicodeStream(java.lang.String columnName)
DOCUMENT ME! |
(package private) long |
getUpdateCount()
|
(package private) long |
getUpdateID()
|
java.net.URL |
getURL(int colIndex)
This method returns the specified column value as a java.net.URL. |
java.net.URL |
getURL(java.lang.String colName)
This method returns the specified column value as a java.net.URL. |
java.sql.SQLWarning |
getWarnings()
The first warning reported by calls on this ResultSet is returned. |
void |
insertRow()
JDBC 2.0 Insert the contents of the insert row into the result set and the database. |
boolean |
isAfterLast()
JDBC 2.0 |
boolean |
isBeforeFirst()
JDBC 2.0 |
boolean |
isFirst()
JDBC 2.0 |
boolean |
isLast()
JDBC 2.0 |
boolean |
last()
JDBC 2.0 |
void |
moveToCurrentRow()
JDBC 2.0 Move the cursor to the remembered cursor position, usually the current row. |
void |
moveToInsertRow()
JDBC 2.0 Move to the insert row. |
boolean |
next()
A ResultSet is initially positioned before its first row, the first call to next makes the first row the current row; the second call makes the second row the current row, etc. |
boolean |
prev()
The prev method is not part of JDBC, but because of the architecture of this driver it is possible to move both forward and backward within the result set. |
boolean |
previous()
JDBC 2.0 |
protected void |
realClose(boolean closeRowData)
|
(package private) boolean |
reallyResult()
|
void |
refreshRow()
JDBC 2.0 Refresh the value of the current row with its current value in the database. |
boolean |
relative(int rows)
JDBC 2.0 |
boolean |
rowDeleted()
JDBC 2.0 Determine if this row has been deleted. |
boolean |
rowInserted()
JDBC 2.0 Determine if the current row has been inserted. |
boolean |
rowUpdated()
JDBC 2.0 Determine if the current row has been updated. |
void |
setConnection(Connection conn)
DOCUMENT ME! |
void |
setFetchDirection(int direction)
JDBC 2.0 Give a hint as to the direction in which the rows in this result set will be processed. |
void |
setFetchSize(int rows)
JDBC 2.0 Give the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for this result set. |
protected void |
setFirstCharOfQuery(char c)
Sets the first character of the query that this result set was created from. |
protected void |
setResultSetConcurrency(int concurrencyFlag)
Sets the concurrency (JDBC2) |
protected void |
setResultSetType(int typeFlag)
Sets the result set type for (JDBC2) |
protected void |
setServerInfo(java.lang.String info)
Sets server info (if any) |
(package private) void |
setStatement(Statement stmt)
|
void |
updateArray(int arg0,
java.sql.Array arg1)
This method updates the specified column to have a java.sqlArray value. |
void |
updateArray(java.lang.String arg0,
java.sql.Array arg1)
This method updates the specified column to have a java.sqlArray value. |
void |
updateAsciiStream(int columnIndex,
java.io.InputStream x,
int length)
JDBC 2.0 Update a column with an ascii stream value. |
void |
updateAsciiStream(java.lang.String columnName,
java.io.InputStream x,
int length)
JDBC 2.0 Update a column with an ascii stream value. |
void |
updateBigDecimal(int columnIndex,
java.math.BigDecimal x)
JDBC 2.0 Update a column with a BigDecimal value. |
void |
updateBigDecimal(java.lang.String columnName,
java.math.BigDecimal x)
JDBC 2.0 Update a column with a BigDecimal value. |
void |
updateBinaryStream(int columnIndex,
java.io.InputStream x,
int length)
JDBC 2.0 Update a column with a binary stream value. |
void |
updateBinaryStream(java.lang.String columnName,
java.io.InputStream x,
int length)
JDBC 2.0 Update a column with a binary stream value. |
void |
updateBlob(int arg0,
java.sql.Blob arg1)
This method updates the specified column to have a java.sql.Blob value. |
void |
updateBlob(java.lang.String arg0,
java.sql.Blob arg1)
This method updates the specified column to have a java.sql.Blob value. |
void |
updateBoolean(int columnIndex,
boolean x)
JDBC 2.0 Update a column with a boolean value. |
void |
updateBoolean(java.lang.String columnName,
boolean x)
JDBC 2.0 Update a column with a boolean value. |
void |
updateByte(int columnIndex,
byte x)
JDBC 2.0 Update a column with a byte value. |
void |
updateByte(java.lang.String columnName,
byte x)
JDBC 2.0 Update a column with a byte value. |
void |
updateBytes(int columnIndex,
byte[] x)
JDBC 2.0 Update a column with a byte array value. |
void |
updateBytes(java.lang.String columnName,
byte[] x)
JDBC 2.0 Update a column with a byte array value. |
void |
updateCharacterStream(int columnIndex,
java.io.Reader x,
int length)
JDBC 2.0 Update a column with a character stream value. |
void |
updateCharacterStream(java.lang.String columnName,
java.io.Reader reader,
int length)
JDBC 2.0 Update a column with a character stream value. |
void |
updateClob(int arg0,
java.sql.Clob arg1)
This method updates the specified column to have a java.sql.Clob value. |
void |
updateClob(java.lang.String columnName,
java.sql.Clob clob)
This method updates the specified column to have a java.sql.Clob value. |
void |
updateDate(int columnIndex,
java.sql.Date x)
JDBC 2.0 Update a column with a Date value. |
void |
updateDate(java.lang.String columnName,
java.sql.Date x)
JDBC 2.0 Update a column with a Date value. |
void |
updateDouble(int columnIndex,
double x)
JDBC 2.0 Update a column with a Double value. |
void |
updateDouble(java.lang.String columnName,
double x)
JDBC 2.0 Update a column with a double value. |
void |
updateFloat(int columnIndex,
float x)
JDBC 2.0 Update a column with a float value. |
void |
updateFloat(java.lang.String columnName,
float x)
JDBC 2.0 Update a column with a float value. |
void |
updateInt(int columnIndex,
int x)
JDBC 2.0 Update a column with an integer value. |
void |
updateInt(java.lang.String columnName,
int x)
JDBC 2.0 Update a column with an integer value. |
void |
updateLong(int columnIndex,
long x)
JDBC 2.0 Update a column with a long value. |
void |
updateLong(java.lang.String columnName,
long x)
JDBC 2.0 Update a column with a long value. |
void |
updateNull(int columnIndex)
JDBC 2.0 Give a nullable column a null value. |
void |
updateNull(java.lang.String columnName)
JDBC 2.0 Update a column with a null value. |
void |
updateObject(int columnIndex,
java.lang.Object x)
JDBC 2.0 Update a column with an Object value. |
void |
updateObject(int columnIndex,
java.lang.Object x,
int scale)
JDBC 2.0 Update a column with an Object value. |
void |
updateObject(java.lang.String columnName,
java.lang.Object x)
JDBC 2.0 Update a column with an Object value. |
void |
updateObject(java.lang.String columnName,
java.lang.Object x,
int scale)
JDBC 2.0 Update a column with an Object value. |
void |
updateRef(int arg0,
java.sql.Ref arg1)
This method updates the specified column to have a java.sql.Ref value. |
void |
updateRef(java.lang.String arg0,
java.sql.Ref arg1)
This method updates the specified column to have a java.sql.Ref value. |
void |
updateRow()
JDBC 2.0 Update the underlying database with the new contents of the current row. |
void |
updateShort(int columnIndex,
short x)
JDBC 2.0 Update a column with a short value. |
void |
updateShort(java.lang.String columnName,
short x)
JDBC 2.0 Update a column with a short value. |
void |
updateString(int columnIndex,
java.lang.String x)
JDBC 2.0 Update a column with a String value. |
void |
updateString(java.lang.String columnName,
java.lang.String x)
JDBC 2.0 Update a column with a String value. |
void |
updateTime(int columnIndex,
java.sql.Time x)
JDBC 2.0 Update a column with a Time value. |
void |
updateTime(java.lang.String columnName,
java.sql.Time x)
JDBC 2.0 Update a column with a Time value. |
void |
updateTimestamp(int columnIndex,
java.sql.Timestamp x)
JDBC 2.0 Update a column with a Timestamp value. |
void |
updateTimestamp(java.lang.String columnName,
java.sql.Timestamp x)
JDBC 2.0 Update a column with a Timestamp value. |
boolean |
wasNull()
A column may have the value of SQL NULL; wasNull() reports whether the last column read had this special value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
defaultTimeZone
private java.util.TimeZone defaultTimeZone
- This method ends up being staticly synchronized, so just store our own
copy....
connection
protected Connection connection
- The Connection instance that created us
columnNameToIndex
protected java.util.Map columnNameToIndex
- Map column names (and all of their permutations) to column indices
fullColumnNameToIndex
protected java.util.Map fullColumnNameToIndex
- Map of fully-specified column names to column indices
rowData
protected RowData rowData
- The actual rows
warningChain
protected java.sql.SQLWarning warningChain
- The warning chain
owningStatement
protected Statement owningStatement
- The statement that created us
catalog
protected java.lang.String catalog
- The catalog that was in use when we were created
serverInfo
protected java.lang.String serverInfo
- Any info message from the server that was created while generating this
result set (if 'info parsing' is enabled for the connection).
fields
protected Field[] fields
- The fields for this result set
thisRow
protected byte[][] thisRow
- Pointer to current row data
doingUpdates
protected boolean doingUpdates
- Are we in the middle of doing updates to the current row?
isClosed
protected boolean isClosed
- Has this result set been closed?
onInsertRow
protected boolean onInsertRow
- Are we on the insert row?
reallyResult
protected boolean reallyResult
- Do we actually contain rows, or just information about
UPDATE/INSERT/DELETE?
wasNullFlag
protected boolean wasNullFlag
- Did the previous value retrieval find a NULL?
firstCharOfQuery
protected char firstCharOfQuery
- First character of the query that created this result set...Used to
determine whether or not to parse server info messages in certain
circumstances.
currentRow
protected int currentRow
- The current row #, -1 == before start of result set
fetchDirection
protected int fetchDirection
- The direction to fetch rows (always FETCH_FORWARD)
fetchSize
protected int fetchSize
- The number of rows to fetch in one go...
resultSetConcurrency
protected int resultSetConcurrency
- Are we read-only or updatable?
resultSetType
protected int resultSetType
- Are we scroll-sensitive/insensitive?
updateCount
protected long updateCount
- How many rows were affected by UPDATE/INSERT/DELETE?
updateId
protected long updateId
- Value generated for AUTO_INCREMENT columns
fastDateCal
private java.util.Calendar fastDateCal
hasBuiltIndexMapping
private boolean hasBuiltIndexMapping
useStrictFloatingPoint
private boolean useStrictFloatingPoint
| Constructor Detail |
ResultSet
public ResultSet(long updateCount,
long updateID)
- Create a result set for an executeUpdate statement.
ResultSet
public ResultSet(java.lang.String catalog, Field[] fields, RowData tuples, Connection conn) throws java.sql.SQLException
- Create a new ResultSet
ResultSet
public ResultSet(Field[] fields, RowData tuples) throws java.sql.SQLException
- Creates a new ResultSet object.
| Method Detail |
isAfterLast
public boolean isAfterLast()
throws java.sql.SQLException
- JDBC 2.0
Determine if the cursor is after the last row in the result set.
- Specified by:
isAfterLastin interfacejava.sql.ResultSet
getArray
public java.sql.Array getArray(int i) throws java.sql.SQLException
- JDBC 2.0 Get an array column.
- Specified by:
getArrayin interfacejava.sql.ResultSet
getArray
public java.sql.Array getArray(java.lang.String colName) throws java.sql.SQLException
- JDBC 2.0 Get an array column.
- Specified by:
getArrayin interfacejava.sql.ResultSet
getAsciiStream
public java.io.InputStream getAsciiStream(int columnIndex) throws java.sql.SQLException
- 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.
- Specified by:
getAsciiStreamin interfacejava.sql.ResultSet
getAsciiStream
public java.io.InputStream getAsciiStream(java.lang.String columnName) throws java.sql.SQLException
- DOCUMENT ME!
- Specified by:
getAsciiStreamin interfacejava.sql.ResultSet
isBeforeFirst
public boolean isBeforeFirst()
throws java.sql.SQLException
- JDBC 2.0
Determine if the cursor is before the first row in the result set.
- Specified by:
isBeforeFirstin interfacejava.sql.ResultSet
getBigDecimal
public java.math.BigDecimal getBigDecimal(int columnIndex, int scale) throws java.sql.SQLException
- Get the value of a column in the current row as a java.math.BigDecimal
object
- Specified by:
getBigDecimalin interfacejava.sql.ResultSet
getBigDecimal
public java.math.BigDecimal getBigDecimal(java.lang.String columnName, int scale) throws java.sql.SQLException
- DOCUMENT ME!
- Specified by:
getBigDecimalin interfacejava.sql.ResultSet
getBigDecimal
public java.math.BigDecimal getBigDecimal(int columnIndex) throws java.sql.SQLException
- JDBC 2.0 Get the value of a column in the current row as a
java.math.BigDecimal object.
- Specified by:
getBigDecimalin interfacejava.sql.ResultSet
getBigDecimal
public java.math.BigDecimal getBigDecimal(java.lang.String columnName) throws java.sql.SQLException
- JDBC 2.0 Get the value of a column in the current row as a
java.math.BigDecimal object.
- Specified by:
getBigDecimalin interfacejava.sql.ResultSet
getBinaryStream
public java.io.InputStream getBinaryStream(int columnIndex) throws java.sql.SQLException
- A column value can also be retrieved as a binary strea. This method is
suitable for retrieving LONGVARBINARY values.
- Specified by:
getBinaryStreamin interfacejava.sql.ResultSet
getBinaryStream
public java.io.InputStream getBinaryStream(java.lang.String columnName) throws java.sql.SQLException
- DOCUMENT ME!
- Specified by:
getBinaryStreamin interfacejava.sql.ResultSet
getBlob
public java.sql.Blob getBlob(int columnIndex) throws java.sql.SQLException
- JDBC 2.0 Get a BLOB column.
- Specified by:
getBlobin interfacejava.sql.ResultSet
getBlob
public java.sql.Blob getBlob(java.lang.String colName) throws java.sql.SQLException
- JDBC 2.0 Get a BLOB column.
- Specified by:
getBlobin interfacejava.sql.ResultSet
getBoolean
public boolean getBoolean(int columnIndex)
throws java.sql.SQLException
- Get the value of a column in the current row as a Java boolean
- Specified by:
getBooleanin interfacejava.sql.ResultSet
getBoolean
public boolean getBoolean(java.lang.String columnName) throws java.sql.SQLException
- DOCUMENT ME!
- Specified by:
getBooleanin interfacejava.sql.ResultSet
getByte
public byte getByte(int columnIndex)
throws java.sql.SQLException
- Get the value of a column in the current row as a Java byte.
- Specified by:
getBytein interfacejava.sql.ResultSet
getByte
public byte getByte(java.lang.String columnName) throws java.sql.SQLException
- DOCUMENT ME!
- Specified by:
getBytein interfacejava.sql.ResultSet
getBytes
public byte[] getBytes(int columnIndex)
throws java.sql.SQLException
- Get the value of a column in the current row as a Java byte array.
Be warned If the blob is huge, then you may run out of memory.
- Specified by:
getBytesin interfacejava.sql.ResultSet
getBytes
public byte[] getBytes(java.lang.String columnName) throws java.sql.SQLException
- DOCUMENT ME!
- Specified by:
getBytesin interfacejava.sql.ResultSet
getCharacterStream
public java.io.Reader getCharacterStream(int columnIndex) throws java.sql.SQLException
- JDBC 2.0
Get the value of a column in the current row as a java.io.Reader.
- Specified by:
getCharacterStreamin interfacejava.sql.ResultSet
getCharacterStream
public java.io.Reader getCharacterStream(java.lang.String columnName) throws java.sql.SQLException
- JDBC 2.0
Get the value of a column in the current row as a java.io.Reader.
- Specified by:
getCharacterStreamin interfacejava.sql.ResultSet
getClob
public java.sql.Clob getClob(int i) throws java.sql.SQLException
- JDBC 2.0 Get a CLOB column.
- Specified by:
getClobin interfacejava.sql.ResultSet
getClob
public java.sql.Clob getClob(java.lang.String colName) throws java.sql.SQLException
- JDBC 2.0 Get a CLOB column.
- Specified by:
getClobin interfacejava.sql.ResultSet
getConcurrency
public int getConcurrency()
throws java.sql.SQLException
- JDBC 2.0 Return the concurrency of this result set. The concurrency
used is determined by the statement that created the result set.
- Specified by:
getConcurrencyin interfacejava.sql.ResultSet
setConnection
public void setConnection(Connection conn)
- DOCUMENT ME!
getCursorName
public java.lang.String getCursorName() throws java.sql.SQLException
- Get the name of the SQL cursor used by this ResultSet
In SQL, a result table is retrieved though a cursor that is named. The current row of a result can be updated or deleted using a positioned update/delete statement that references the cursor name.
JDBC supports this SQL feature by providing the name of the SQL cursor used by a ResultSet. The current row of a ResulSet is also the current row of this SQL cursor.
Note: If positioned update is not supported, a java.sql.SQLException is thrown.
- Specified by:
getCursorNamein interfacejava.sql.ResultSet
getDate
public java.sql.Date getDate(int columnIndex) throws java.sql.SQLException
- Get the value of a column in the current row as a java.sql.Date object
- Specified by:
getDatein interfacejava.sql.ResultSet
getDate
public java.sql.Date getDate(java.lang.String columnName) throws java.sql.SQLException
- DOCUMENT ME!
- Specified by:
getDatein interfacejava.sql.ResultSet
getDate
public java.sql.Date getDate(int columnIndex, java.util.Calendar cal) throws java.sql.SQLException
- JDBC 2.0 Get the value of a column in the current row as a java.sql.Date
object. Use the calendar to construct an appropriate millisecond value
for the Date, if the underlying database doesn't store timezone
information.
- Specified by:
getDatein interfacejava.sql.ResultSet
getDate
public java.sql.Date getDate(java.lang.String columnName, java.util.Calendar cal) throws java.sql.SQLException
- Get the value of a column in the current row as a java.sql.Date object.
Use the calendar to construct an appropriate millisecond value for the
Date, if the underlying database doesn't store timezone information.
- Specified by:
getDatein interfacejava.sql.ResultSet
getDouble
public double getDouble(int columnIndex)
throws java.sql.SQLException
- Get the value of a column in the current row as a Java double.
- Specified by:
getDoublein interfacejava.sql.ResultSet
getDouble
public double getDouble(java.lang.String columnName) throws java.sql.SQLException
- DOCUMENT ME!
- Specified by:
getDoublein interfacejava.sql.ResultSet
setFetchDirection
public void setFetchDirection(int direction)
throws java.sql.SQLException
- JDBC 2.0 Give a hint as to the direction in which the rows in this
result set will be processed. The initial value is determined by the
statement that produced the result set. The fetch direction may be
changed at any time.
- Specified by:
setFetchDirectionin interfacejava.sql.ResultSet
getFetchDirection
public int getFetchDirection()
throws java.sql.SQLException
- JDBC 2.0 Returns the fetch direction for this result set.
- Specified by:
getFetchDirectionin interfacejava.sql.ResultSet
setFetchSize
public void setFetchSize(int rows)
throws java.sql.SQLException
- JDBC 2.0 Give the JDBC driver a hint as to the number of rows that
should be fetched from the database when more rows are needed for this
result set. If the fetch size specified is zero, then the JDBC driver
ignores the value, and is free to make its own best guess as to what
the fetch size should be. The default value is set by the statement
that creates the result set. The fetch size may be changed at any
time.
- Specified by:
setFetchSizein interfacejava.sql.ResultSet
getFetchSize
public int getFetchSize()
throws java.sql.SQLException
- JDBC 2.0 Return the fetch size for this result set.
- Specified by:
getFetchSizein interfacejava.sql.ResultSet
isFirst
public boolean isFirst()
JAVADOC
com.mysql.jdbc.ResultSet