com.mysql.jdbc
Class JDBC4ResultSet

java.lang.Object
  extended by com.mysql.jdbc.ResultSetImpl
      extended by com.mysql.jdbc.JDBC4ResultSet
All Implemented Interfaces:
ResultSetInternalMethods, java.sql.ResultSet, java.sql.Wrapper

public class JDBC4ResultSet
extends ResultSetImpl


Field Summary
 
Fields inherited from class com.mysql.jdbc.ResultSetImpl
catalog, columnLabelToIndex, columnNameToIndex, columnToIndexCache, columnUsed, connection, connectionId, currentRow, defaultTimeZone, doingUpdates, EMPTY_SPACE, eventSink, fastDateCal, fetchDirection, fetchSize, fields, firstCharOfQuery, fullColumnNameToIndex, gmtCalendar, hasBuiltIndexMapping, isBinaryEncoded, isClosed, MAX_DIFF_PREC, MIN_DIFF_PREC, nextResultSet, onInsertRow, owningStatement, pointOfOrigin, profileSql, reallyResult, resultCounter, resultId, resultSetConcurrency, resultSetType, retainOwningStatement, rowData, serverInfo, statementUsedForFetchingRows, thisRow, updateCount, updateId, useFastDateParsing, useLegacyDatetimeCode, useUsageAdvisor, warningChain, wasNullFlag, wrapperStatement
 
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
JDBC4ResultSet(long updateCount, long updateID, ConnectionImpl conn, StatementImpl creatorStmt)
           
JDBC4ResultSet(java.lang.String catalog, Field[] fields, RowData tuples, ConnectionImpl conn, StatementImpl creatorStmt)
           
 
Method Summary
 int getHoldability()
           
protected  java.sql.NClob getNativeNClob(int columnIndex)
          JDBC 4.0 Get a NCLOB column.
 java.io.Reader getNCharacterStream(int columnIndex)
          JDBC 4.0 Get the value of a column in the current row as a java.io.Reader.
 java.io.Reader getNCharacterStream(java.lang.String columnName)
          JDBC 4.0 Get the value of a column in the current row as a java.io.Reader.
 java.sql.NClob getNClob(int columnIndex)
          JDBC 4.0 Get a NCLOB column.
 java.sql.NClob getNClob(java.lang.String columnName)
          JDBC 4.0 Get a NCLOB column.
 java.lang.String getNString(int columnIndex)
          JDBC 4.0 Get the value of a column in the current row as a Java String
 java.lang.String getNString(java.lang.String columnName)
          JDBC 4.0 The following routines simply convert the columnName into a columnIndex and then call the appropriate routine above.
 java.sql.RowId getRowId(int columnIndex)
           
 java.sql.RowId getRowId(java.lang.String columnLabel)
           
 java.sql.SQLXML getSQLXML(int columnIndex)
           
 java.sql.SQLXML getSQLXML(java.lang.String columnLabel)
           
 boolean isClosed()
           
 boolean isWrapperFor(java.lang.Class<?> iface)
          Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.
<T> T
unwrap(java.lang.Class<T> iface)
          Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.
 void updateAsciiStream(int columnIndex, java.io.InputStream x)
           
 void updateAsciiStream(int columnIndex, java.io.InputStream x, long length)
           
 void updateAsciiStream(java.lang.String columnLabel, java.io.InputStream x)
           
 void updateAsciiStream(java.lang.String columnLabel, java.io.InputStream x, long length)
           
 void updateBinaryStream(int columnIndex, java.io.InputStream x)
           
 void updateBinaryStream(int columnIndex, java.io.InputStream x, long length)
           
 void updateBinaryStream(java.lang.String columnLabel, java.io.InputStream x)
           
 void updateBinaryStream(java.lang.String columnLabel, java.io.InputStream x, long length)
           
 void updateBlob(int columnIndex, java.io.InputStream inputStream)
           
 void updateBlob(int columnIndex, java.io.InputStream inputStream, long length)
           
 void updateBlob(java.lang.String columnLabel, java.io.InputStream inputStream)
           
 void updateBlob(java.lang.String columnLabel, java.io.InputStream inputStream, long length)
           
 void updateCharacterStream(int columnIndex, java.io.Reader x)
           
 void updateCharacterStream(int columnIndex, java.io.Reader x, long length)
           
 void updateCharacterStream(java.lang.String columnLabel, java.io.Reader reader)
           
 void updateCharacterStream(java.lang.String columnLabel, java.io.Reader reader, long length)
           
 void updateClob(int columnIndex, java.io.Reader reader)
           
 void updateClob(int columnIndex, java.io.Reader reader, long length)
           
 void updateClob(java.lang.String columnLabel, java.io.Reader reader)
           
 void updateClob(java.lang.String columnLabel, java.io.Reader reader, long length)
           
 void updateNCharacterStream(int columnIndex, java.io.Reader x)
           
 void updateNCharacterStream(int columnIndex, java.io.Reader x, int length)
          JDBC 4.0 Update a column with a character stream value.
 void updateNCharacterStream(int columnIndex, java.io.Reader x, long length)
           
 void updateNCharacterStream(java.lang.String columnLabel, java.io.Reader reader)
           
 void updateNCharacterStream(java.lang.String columnName, java.io.Reader reader, int length)
          JDBC 4.0 Update a column with a character stream value.
 void updateNCharacterStream(java.lang.String columnLabel, java.io.Reader reader, long length)
           
 void updateNClob(int columnIndex, java.sql.NClob nClob)
           
 void updateNClob(int columnIndex, java.io.Reader reader)
           
 void updateNClob(int columnIndex, java.io.Reader reader, long length)
           
 void updateNClob(java.lang.String columnName, java.sql.NClob nClob)
           
 void updateNClob(java.lang.String columnLabel, java.io.Reader reader)
           
 void updateNClob(java.lang.String columnLabel, java.io.Reader reader, long length)
           
 void updateNString(int columnIndex, java.lang.String nString)
           
 void updateNString(java.lang.String columnLabel, java.lang.String nString)
           
 void updateRowId(int columnIndex, java.sql.RowId x)
           
 void updateRowId(java.lang.String columnName, java.sql.RowId x)
           
 void updateSQLXML(int columnIndex, java.sql.SQLXML xmlObject)
           
 void updateSQLXML(java.lang.String columnLabel, java.sql.SQLXML xmlObject)
           
 
Methods inherited from class com.mysql.jdbc.ResultSetImpl
absolute, afterLast, arraysEqual, beforeFirst, buildIndexMapping, cancelRowUpdates, checkClosed, checkColumnBounds, checkRowPos, clearNextResult, clearWarnings, close, convertLongToUlong, copy, deleteRow, fastDateCreate, fastTimeCreate, fastTimestampCreate, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getBytes, getBytesSize, getCalendarInstanceForSessionOrNew, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getDoubleInternal, getDoubleInternal, getExceptionInterceptor, getFetchDirection, getFetchSize, getFirstCharOfQuery, getFloat, getFloat, getGmtCalendar, getInstance, getInstance, getInt, getInt, getLong, getLong, getMetaData, getNativeArray, getNativeAsciiStream, getNativeBigDecimal, getNativeBigDecimal, getNativeBinaryStream, getNativeBlob, getNativeByte, getNativeByte, getNativeBytes, getNativeCharacterStream, getNativeClob, getNativeDate, getNativeDate, getNativeDateViaParseConversion, getNativeDouble, getNativeFloat, getNativeInt, getNativeInt, getNativeLong, getNativeLong, getNativeRef, getNativeShort, getNativeShort, getNativeString, getNativeTimestampViaParseConversion, getNativeTimeViaParseConversion, getNativeUnicodeStream, getNativeURL, getNextResultSet, getObject, getObject, getObject, getObject, getObjectStoredProc, getObjectStoredProc, getObjectStoredProc, getObjectStoredProc, getRef, getRef, getRow, getServerInfo, getShort, getShort, getStatement, getString, getString, getStringInternal, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getUpdateCount, getUpdateID, getURL, getURL, getWarnings, initializeFromCachedMetaData, initializeWithMetadata, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, next, populateCachedMetaData, prev, previous, realClose, reallyResult, redefineFieldsForDBMD, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setBinaryEncoded, setFetchDirection, setFetchSize, setFirstCharOfQuery, setNextResultSet, setOwningStatement, setResultSetConcurrency, setResultSetType, setServerInfo, setStatementUsedForFetchingRows, setWrapperStatement, toString, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JDBC4ResultSet

public JDBC4ResultSet(long updateCount,
                      long updateID,
                      ConnectionImpl conn,
                      StatementImpl creatorStmt)

JDBC4ResultSet

public JDBC4ResultSet(java.lang.String catalog,
                      Field[] fields,
                      RowData tuples,
                      ConnectionImpl conn,
                      StatementImpl creatorStmt)
               throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

getNCharacterStream

public java.io.Reader getNCharacterStream(int columnIndex)
                                   throws java.sql.SQLException
JDBC 4.0

Get the value of a column in the current row as a java.io.Reader.

Parameters:
columnIndex - the column to get the value from
Returns:
the value in the column as a java.io.Reader.
Throws:
java.sql.SQLException - if an error occurs

getNCharacterStream

public java.io.Reader getNCharacterStream(java.lang.String columnName)
                                   throws java.sql.SQLException
JDBC 4.0

Get the value of a column in the current row as a java.io.Reader.

Parameters:
columnName - the column name to retrieve the value from
Returns:
the value as a java.io.Reader
Throws:
java.sql.SQLException - if an error occurs

getNClob

public java.sql.NClob getNClob(int columnIndex)
                        throws java.sql.SQLException
JDBC 4.0 Get a NCLOB column.

Parameters:
i - the first column is 1, the second is 2, ...
Returns:
an object representing a NCLOB
Throws:
java.sql.SQLException - if an error occurs

getNClob

public java.sql.NClob getNClob(java.lang.String columnName)
                        throws java.sql.SQLException
JDBC 4.0 Get a NCLOB column.

Parameters:
colName - the column name
Returns:
an object representing a NCLOB
Throws:
java.sql.SQLException - if an error occurs

getNativeNClob

protected java.sql.NClob getNativeNClob(int columnIndex)
                                 throws java.sql.SQLException
JDBC 4.0 Get a NCLOB column.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
Returns:
an object representing a NCLOB
Throws:
java.sql.SQLException - if an error occurs

getNString

public java.lang.String getNString(int columnIndex)
                            throws java.sql.SQLException
JDBC 4.0 Get the value of a column in the current row as a Java String

Parameters:
columnIndex - the first column is 1, the second is 2...
Returns:
the column value, null for SQL NULL
Throws:
java.sql.SQLException - if a database access error occurs

getNString

public java.lang.String getNString(java.lang.String columnName)
                            throws java.sql.SQLException
JDBC 4.0 The following routines simply convert the columnName into a columnIndex and then call the appropriate routine above.

Parameters:
columnName - is the SQL name of the column
Returns:
the column value
Throws:
java.sql.SQLException - if a database access error occurs

updateNCharacterStream

public void updateNCharacterStream(int columnIndex,
                                   java.io.Reader x,
                                   int length)
                            throws java.sql.SQLException
JDBC 4.0 Update a column with a character stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
length - the length of the stream
Throws:
java.sql.SQLException - if a database-access error occurs
NotUpdatable - DOCUMENT ME!

updateNCharacterStream

public void updateNCharacterStream(java.lang.String columnName,
                                   java.io.Reader reader,
                                   int length)
                            throws java.sql.SQLException
JDBC 4.0 Update a column with a character stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database.

Parameters:
columnName - the name of the column
reader - the stream to update the column with
length - of the stream
Throws:
java.sql.SQLException - if a database-access error occurs

updateNClob

public void updateNClob(java.lang.String columnName,
                        java.sql.NClob nClob)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException
See Also:
ResultSet#updateNClob(String, NClob)

updateRowId

public void updateRowId(int columnIndex,
                        java.sql.RowId x)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateRowId

public void updateRowId(java.lang.String columnName,
                        java.sql.RowId x)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

getHoldability

public int getHoldability()
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getRowId

public java.sql.RowId getRowId(int columnIndex)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getRowId

public java.sql.RowId getRowId(java.lang.String columnLabel)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getSQLXML

public java.sql.SQLXML getSQLXML(int columnIndex)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

getSQLXML

public java.sql.SQLXML getSQLXML(java.lang.String columnLabel)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

isClosed

public boolean isClosed()
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateAsciiStream

public void updateAsciiStream(int columnIndex,
                              java.io.InputStream x)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

updateAsciiStream

public void updateAsciiStream(java.lang.String columnLabel,
                              java.io.InputStream x)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

updateAsciiStream

public void updateAsciiStream(int columnIndex,
                              java.io.InputStream x,
                              long length)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

updateAsciiStream

public void updateAsciiStream(java.lang.String columnLabel,
                              java.io.InputStream x,
                              long length)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBinaryStream

public void updateBinaryStream(int columnIndex,
                               java.io.InputStream x)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBinaryStream

public void updateBinaryStream(java.lang.String columnLabel,
                               java.io.InputStream x)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBinaryStream

public void updateBinaryStream(int columnIndex,
                               java.io.InputStream x,
                               long length)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBinaryStream

public void updateBinaryStream(java.lang.String columnLabel,
                               java.io.InputStream x,
                               long length)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBlob

public void updateBlob(int columnIndex,
                       java.io.InputStream inputStream)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBlob

public void updateBlob(java.lang.String columnLabel,
                       java.io.InputStream inputStream)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBlob

public void updateBlob(int columnIndex,
                       java.io.InputStream inputStream,
                       long length)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateBlob

public void updateBlob(java.lang.String columnLabel,
                       java.io.InputStream inputStream,
                       long length)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateCharacterStream

public void updateCharacterStream(int columnIndex,
                                  java.io.Reader x)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

updateCharacterStream

public void updateCharacterStream(java.lang.String columnLabel,
                                  java.io.Reader reader)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

updateCharacterStream

public void updateCharacterStream(int columnIndex,
                                  java.io.Reader x,
                                  long length)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

updateCharacterStream

public void updateCharacterStream(java.lang.String columnLabel,
                                  java.io.Reader reader,
                                  long length)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

updateClob

public void updateClob(int columnIndex,
                       java.io.Reader reader)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateClob

public void updateClob(java.lang.String columnLabel,
                       java.io.Reader reader)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateClob

public void updateClob(int columnIndex,
                       java.io.Reader reader,
                       long length)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateClob

public void updateClob(java.lang.String columnLabel,
                       java.io.Reader reader,
                       long length)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNCharacterStream

public void updateNCharacterStream(int columnIndex,
                                   java.io.Reader x)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNCharacterStream

public void updateNCharacterStream(java.lang.String columnLabel,
                                   java.io.Reader reader)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNCharacterStream

public void updateNCharacterStream(int columnIndex,
                                   java.io.Reader x,
                                   long length)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNCharacterStream

public void updateNCharacterStream(java.lang.String columnLabel,
                                   java.io.Reader reader,
                                   long length)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(int columnIndex,
                        java.sql.NClob nClob)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(int columnIndex,
                        java.io.Reader reader)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(java.lang.String columnLabel,
                        java.io.Reader reader)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(int columnIndex,
                        java.io.Reader reader,
                        long length)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNClob

public void updateNClob(java.lang.String columnLabel,
                        java.io.Reader reader,
                        long length)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNString

public void updateNString(int columnIndex,
                          java.lang.String nString)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

updateNString

public void updateNString(java.lang.String columnLabel,
                          java.lang.String nString)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

updateSQLXML

public void updateSQLXML(int columnIndex,
                         java.sql.SQLXML xmlObject)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

updateSQLXML

public void updateSQLXML(java.lang.String columnLabel,
                         java.sql.SQLXML xmlObject)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> iface)
                     throws java.sql.SQLException
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with the same argument should succeed.

Parameters:
interfaces - a Class defining an interface.
Returns:
true if this implements the interface or directly or indirectly wraps an object that does.
Throws:
java.sql.SQLException - if an error occurs while determining whether this is a wrapper for an object with the given interface.
Since:
1.6

unwrap

public <T> T unwrap(java.lang.Class<T> iface)
         throws java.sql.SQLException
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. The result may be either the object found to implement the interface or a proxy for that object. If the receiver implements the interface then that is the object. If the receiver is a wrapper and the wrapped object implements the interface then that is the object. Otherwise the object is the result of calling unwrap recursively on the wrapped object. If the receiver is not a wrapper and does not implement the interface, then an SQLException is thrown.

Parameters:
iface - A Class defining an interface that the result must implement.
Returns:
an object that implements the interface. May be a proxy for the actual implementing object.
Throws:
java.sql.SQLException - If no object found that implements the interface
Since:
1.6