Logo Search packages:      
Sourcecode: mysql-connector-java version File versions

com::mysql::jdbc::ResultSet Class Reference

Inheritance diagram for com::mysql::jdbc::ResultSet:

com::mysql::jdbc::UpdatableResultSet

List of all members.


Detailed Description

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.

Author:
Mark Matthews
Version:
Id
ResultSet.java,v 1.18.4.87 2005/02/17 21:42:27 mmatthews Exp

See also:
ResultSetMetaData

java.sql.ResultSet

Definition at line 118 of file ResultSet.java.


Public Member Functions

boolean absolute (int row) throws SQLException
void afterLast () throws SQLException
void beforeFirst () throws SQLException
void cancelRowUpdates () throws SQLException
void clearWarnings () throws SQLException
void close () throws SQLException
void deleteRow () throws SQLException
synchronized int findColumn (String columnName) throws SQLException
boolean first () throws SQLException
java.sql.Array getArray (String colName) throws SQLException
java.sql.Array getArray (int i) throws SQLException
InputStream getAsciiStream (String columnName) throws SQLException
InputStream getAsciiStream (int columnIndex) throws SQLException
BigDecimal getBigDecimal (String columnName) throws SQLException
BigDecimal getBigDecimal (int columnIndex) throws SQLException
BigDecimal getBigDecimal (String columnName, int scale) throws SQLException
BigDecimal getBigDecimal (int columnIndex, int scale) throws SQLException
InputStream getBinaryStream (String columnName) throws SQLException
InputStream getBinaryStream (int columnIndex) throws SQLException
java.sql.Blob getBlob (String colName) throws SQLException
java.sql.Blob getBlob (int columnIndex) throws SQLException
boolean getBoolean (String columnName) throws SQLException
boolean getBoolean (int columnIndex) throws SQLException
byte getByte (String columnName) throws SQLException
byte getByte (int columnIndex) throws SQLException
byte[] getBytes (String columnName) throws SQLException
byte[] getBytes (int columnIndex) throws SQLException
java.io.Reader getCharacterStream (String columnName) throws SQLException
java.io.Reader getCharacterStream (int columnIndex) throws SQLException
java.sql.Clob getClob (String colName) throws SQLException
java.sql.Clob getClob (int i) throws SQLException
int getConcurrency () throws SQLException
String getCursorName () throws SQLException
java.sql.Date getDate (String columnName, Calendar cal) throws SQLException
java.sql.Date getDate (int columnIndex, Calendar cal) throws SQLException
java.sql.Date getDate (String columnName) throws java.sql.SQLException
java.sql.Date getDate (int columnIndex) throws java.sql.SQLException
double getDouble (String columnName) throws SQLException
double getDouble (int columnIndex) throws SQLException
int getFetchDirection () throws SQLException
int getFetchSize () throws SQLException
float getFloat (String columnName) throws SQLException
float getFloat (int columnIndex) throws SQLException
int getInt (String columnName) throws SQLException
int getInt (int columnIndex) throws SQLException
long getLong (String columnName) throws SQLException
long getLong (int columnIndex) throws SQLException
java.sql.ResultSetMetaData getMetaData () throws SQLException
Object getObject (String colName, java.util.Map map) throws SQLException
Object getObject (int i, java.util.Map map) throws SQLException
Object getObject (String columnName) throws SQLException
Object getObject (int columnIndex) throws SQLException
java.sql.Ref getRef (String colName) throws SQLException
java.sql.Ref getRef (int i) throws SQLException
int getRow () throws SQLException
short getShort (String columnName) throws SQLException
short getShort (int columnIndex) throws SQLException
java.sql.Statement getStatement () throws SQLException
String getString (String columnName) throws SQLException
String getString (int columnIndex) throws SQLException
java.sql.Time getTime (String columnName, Calendar cal) throws SQLException
java.sql.Time getTime (int columnIndex, Calendar cal) throws SQLException
Time getTime (String columnName) throws java.sql.SQLException
Time getTime (int columnIndex) throws java.sql.SQLException
java.sql.Timestamp getTimestamp (String columnName, Calendar cal) throws SQLException
Timestamp getTimestamp (String columnName) throws java.sql.SQLException
java.sql.Timestamp getTimestamp (int columnIndex, Calendar cal) throws SQLException
Timestamp getTimestamp (int columnIndex) throws java.sql.SQLException
int getType () throws SQLException
InputStream getUnicodeStream (String columnName) throws SQLException
InputStream getUnicodeStream (int columnIndex) throws SQLException
URL getURL (String colName) throws SQLException
URL getURL (int colIndex) throws SQLException
java.sql.SQLWarning getWarnings () throws SQLException
void insertRow () throws SQLException
boolean isAfterLast () throws SQLException
boolean isBeforeFirst () throws SQLException
boolean isFirst () throws SQLException
boolean isLast () throws SQLException
boolean last () throws SQLException
void moveToCurrentRow () throws SQLException
void moveToInsertRow () throws SQLException
boolean next () throws SQLException
boolean prev () throws java.sql.SQLException
boolean previous () throws SQLException
void refreshRow () throws SQLException
boolean relative (int rows) throws SQLException
 ResultSet (String catalog, Field[] fields, RowData tuples, Connection conn, Statement creatorStmt) throws SQLException
 ResultSet (long updateCount, long updateID, Connection conn, Statement creatorStmt)
boolean rowDeleted () throws SQLException
boolean rowInserted () throws SQLException
boolean rowUpdated () throws SQLException
void setFetchDirection (int direction) throws SQLException
void setFetchSize (int rows) throws SQLException
void setWrapperStatement (java.sql.Statement wrapperStatement)
String toString ()
void updateArray (String arg0, Array arg1) throws SQLException
void updateArray (int arg0, Array arg1) throws SQLException
void updateAsciiStream (String columnName, java.io.InputStream x, int length) throws SQLException
void updateAsciiStream (int columnIndex, java.io.InputStream x, int length) throws SQLException
void updateBigDecimal (String columnName, BigDecimal x) throws SQLException
void updateBigDecimal (int columnIndex, BigDecimal x) throws SQLException
void updateBinaryStream (String columnName, java.io.InputStream x, int length) throws SQLException
void updateBinaryStream (int columnIndex, java.io.InputStream x, int length) throws SQLException
void updateBlob (String arg0, java.sql.Blob arg1) throws SQLException
void updateBlob (int arg0, java.sql.Blob arg1) throws SQLException
void updateBoolean (String columnName, boolean x) throws SQLException
void updateBoolean (int columnIndex, boolean x) throws SQLException
void updateByte (String columnName, byte x) throws SQLException
void updateByte (int columnIndex, byte x) throws SQLException
void updateBytes (String columnName, byte[] x) throws SQLException
void updateBytes (int columnIndex, byte[] x) throws SQLException
void updateCharacterStream (String columnName, java.io.Reader reader, int length) throws SQLException
void updateCharacterStream (int columnIndex, java.io.Reader x, int length) throws SQLException
void updateClob (String columnName, java.sql.Clob clob) throws SQLException
void updateClob (int arg0, java.sql.Clob arg1) throws SQLException
void updateDate (String columnName, java.sql.Date x) throws SQLException
void updateDate (int columnIndex, java.sql.Date x) throws SQLException
void updateDouble (String columnName, double x) throws SQLException
void updateDouble (int columnIndex, double x) throws SQLException
void updateFloat (String columnName, float x) throws SQLException
void updateFloat (int columnIndex, float x) throws SQLException
void updateInt (String columnName, int x) throws SQLException
void updateInt (int columnIndex, int x) throws SQLException
void updateLong (String columnName, long x) throws SQLException
void updateLong (int columnIndex, long x) throws SQLException
void updateNull (String columnName) throws SQLException
void updateNull (int columnIndex) throws SQLException
void updateObject (String columnName, Object x) throws SQLException
void updateObject (String columnName, Object x, int scale) throws SQLException
void updateObject (int columnIndex, Object x) throws SQLException
void updateObject (int columnIndex, Object x, int scale) throws SQLException
void updateRef (String arg0, Ref arg1) throws SQLException
void updateRef (int arg0, Ref arg1) throws SQLException
void updateRow () throws SQLException
void updateShort (String columnName, short x) throws SQLException
void updateShort (int columnIndex, short x) throws SQLException
void updateString (String columnName, String x) throws SQLException
void updateString (int columnIndex, String x) throws SQLException
void updateTime (String columnName, java.sql.Time x) throws SQLException
void updateTime (int columnIndex, java.sql.Time x) throws SQLException
void updateTimestamp (String columnName, java.sql.Timestamp x) throws SQLException
void updateTimestamp (int columnIndex, java.sql.Timestamp x) throws SQLException
boolean wasNull () throws SQLException

Protected Member Functions

void buildIndexMapping ()
final synchronized void checkClosed () throws SQLException
final void checkColumnBounds (int columnIndex) throws SQLException
void checkRowPos () throws SQLException
final ResultSet copy () throws SQLException
byte[] getBytes (int columnIndex, boolean noConversion) throws SQLException
double getDoubleInternal (String stringVal, int colIndex) throws SQLException
double getDoubleInternal (int colIndex) throws SQLException
char getFirstCharOfQuery ()
java.sql.Array getNativeArray (int i) throws SQLException
InputStream getNativeAsciiStream (int columnIndex) throws SQLException
BigDecimal getNativeBigDecimal (int columnIndex) throws SQLException
BigDecimal getNativeBigDecimal (int columnIndex, int scale) throws SQLException
InputStream getNativeBinaryStream (int columnIndex) throws SQLException
java.sql.Blob getNativeBlob (int columnIndex) throws SQLException
boolean getNativeBoolean (int columnIndex) throws SQLException
byte getNativeByte (int columnIndex) throws SQLException
byte[] getNativeBytes (int columnIndex, boolean noConversion) throws SQLException
java.io.Reader getNativeCharacterStream (int columnIndex) throws SQLException
java.sql.Clob getNativeClob (int columnIndex) throws SQLException
java.sql.Date getNativeDate (int columnIndex, TimeZone tz) throws SQLException
java.sql.Date getNativeDate (int columnIndex) throws SQLException
double getNativeDouble (int columnIndex) throws SQLException
float getNativeFloat (int columnIndex) throws SQLException
int getNativeInt (int columnIndex) throws SQLException
long getNativeLong (int columnIndex) throws SQLException
java.sql.Ref getNativeRef (int i) throws SQLException
short getNativeShort (int columnIndex) throws SQLException
String getNativeString (int columnIndex) throws SQLException
InputStream getNativeUnicodeStream (int columnIndex) throws SQLException
URL getNativeURL (int colIndex) throws SQLException
ResultSet getNextResultSet ()
Object getObjectStoredProc (int columnIndex, int desiredSqlType) throws SQLException
Object getObjectStoredProc (int i, java.util.Map map, int desiredSqlType) throws SQLException
Object getObjectStoredProc (String colName, java.util.Map map, int desiredSqlType) throws SQLException
Object getObjectStoredProc (String columnName, int desiredSqlType) throws SQLException
String getServerInfo ()
String getStringInternal (int columnIndex, boolean checkDateTypes) throws SQLException
void realClose (boolean calledExplicitly) throws SQLException
void setBinaryEncoded ()
void setFirstCharOfQuery (char c)
void setNextResultSet (ResultSet nextResultSet)
void setResultSetConcurrency (int concurrencyFlag)
void setResultSetType (int typeFlag)
void setServerInfo (String info)

Static Protected Member Functions

static BigInteger convertLongToUlong (long longVal)

Protected Attributes

String catalog = null
Map columnNameToIndex = null
boolean[] columnUsed = null
com.mysql.jdbc.Connection connection
int currentRow = -1
boolean doingUpdates = false
ProfileEventSink eventSink = null
int fetchDirection = FETCH_FORWARD
int fetchSize = 0
Field[] fields
char firstCharOfQuery
Map fullColumnNameToIndex = null
boolean hasBuiltIndexMapping = false
boolean isBinaryEncoded = false
boolean isClosed = false
ResultSet nextResultSet = null
boolean onInsertRow = false
com.mysql.jdbc.Statement owningStatement
Throwable pointOfOrigin
boolean profileSql = false
boolean reallyResult = false
int resultId
int resultSetConcurrency = 0
int resultSetType = 0
RowData rowData
String serverInfo = null
Calendar sessionCalendar
Object[] thisRow = null
long updateCount
long updateId = -1
boolean useUsageAdvisor = false
java.sql.SQLWarning warningChain = null
boolean wasNullFlag = false
java.sql.Statement wrapperStatement

Static Protected Attributes

static int resultCounter = 1

Package Functions

long getUpdateCount ()
long getUpdateID ()
boolean reallyResult ()

Private Member Functions

synchronized void addAWarning (SQLWarning warning)
String extractStringFromNativeColumn (int columnIndex, int mysqlType) throws SQLException
synchronized Date fastDateCreate (Calendar cal, int year, int month, int day)
synchronized Time fastTimeCreate (Calendar cal, int hour, int minute, int second)
synchronized Timestamp fastTimestampCreate (Calendar cal, int year, int month, int day, int hour, int minute, int seconds, int secondsPart)
final BigDecimal getBigDecimalFromString (String stringVal, int columnIndex, int scale) throws SQLException
final boolean getBooleanFromString (String stringVal, int columnIndex) throws SQLException
final byte getByteFromString (String stringVal, int columnIndex) throws SQLException
final byte[] getBytesFromString (String stringVal, int columnIndex) throws SQLException
synchronized Calendar getCalendarInstanceForSessionOrNew ()
final java.io.Reader getCharacterStreamFromString (String stringVal, int columnIndex) throws SQLException
final java.sql.Clob getClobFromString (String stringVal, int columnIndex) throws SQLException
final java.sql.Date getDateFromString (String stringVal, int columnIndex) throws SQLException
synchronized TimeZone getDefaultTimeZone ()
final double getDoubleFromString (String stringVal, int columnIndex) throws SQLException
final float getFloatFromString (String val, int columnIndex) throws SQLException
final int getIntFromString (String val, int columnIndex) throws SQLException
final long getLongFromString (String val, int columnIndex) throws SQLException
String getNativeConvertToString (int columnIndex, Field field) throws SQLException
Time getNativeTime (int columnIndex, TimeZone tz, boolean rollForward) throws SQLException
Timestamp getNativeTimestamp (int columnIndex, TimeZone tz, boolean rollForward) throws SQLException
final short getShortFromString (String val, int columnIndex) throws SQLException
Time getTimeFromString (String timeAsString, int columnIndex, TimeZone tz, boolean rollForward) throws SQLException
Time getTimeInternal (int columnIndex, TimeZone tz, boolean rollForward) throws java.sql.SQLException
Timestamp getTimestampFromString (int columnIndex, String timestampValue, TimeZone tz, boolean rollForward) throws java.sql.SQLException
Timestamp getTimestampInternal (int columnIndex, TimeZone tz, boolean rollForward) throws java.sql.SQLException
void issueConversionViaParsingWarning (String methodName, int columnIndex, Object value, Field fieldInfo, int[] typesWithNoParseConversion)
void issueDataTruncationWarningIfConfigured (int columnIndex, int readSize, int truncatedToSize)
int parseIntAsDouble (int columnIndex, String val) throws NumberFormatException, SQLException
int parseIntWithOverflowCheck (int columnIndex, byte[] valueAsBytes, String valueAsString) throws NumberFormatException, SQLException
long parseLongAsDouble (int columnIndex, String val) throws NumberFormatException, SQLException
long parseLongWithOverflowCheck (int columnIndex, byte[] valueAsBytes, String valueAsString) throws NumberFormatException, SQLException
short parseShortAsDouble (int columnIndex, String val) throws NumberFormatException, SQLException
short parseShortWithOverflowCheck (int columnIndex, byte[] valueAsBytes, String valueAsString) throws NumberFormatException, SQLException
void setDefaultTimeZone (TimeZone defaultTimeZone)
void throwRangeException (String valueAsString, int columnIndex, int jdbcType) throws SQLException

Private Attributes

TimeZone defaultTimeZone
Calendar fastDateCal = null
boolean useStrictFloatingPoint = false

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index