org.apache.commons.dbcp

Class DelegatingResultSet

Implemented Interfaces:
ResultSet

public class DelegatingResultSet
extends AbandonedTrace
implements ResultSet

A base delegating implementation of ResultSet.

All of the methods from the ResultSet interface simply call the corresponding method on the "delegate" provided in my constructor.

Extends AbandonedTrace to implement result set tracking and logging of code which created the ResultSet. Tracking the ResultSet ensures that the Statment which created it can close any open ResultSet's on Statement close.

Version:
$Revision: 1.13 $ $Date: 2004/03/06 13:35:31 $

Authors:
Glenn L. Nielsen
James House
Dirk Verbeeck

Nested Class Summary

Constructor Summary

DelegatingResultSet(Statement stmt, ResultSet res)
Create a wrapper for the ResultSet which traces this ResultSet to the Statement which created it and the code which created it.

Method Summary

boolean
absolute(int row)
void
afterLast()
void
beforeFirst()
void
cancelRowUpdates()
void
clearWarnings()
void
close()
Wrapper for close of ResultSet which removes this result set from being traced then calls close on the original ResultSet.
void
deleteRow()
boolean
equals(Object obj)
int
findColumn(java.lang.String columnName)
boolean
first()
Array
getArray(int i)
Array
getArray(java.lang.String colName)
InputStream
getAsciiStream(int columnIndex)
InputStream
getAsciiStream(java.lang.String columnName)
BigDecimal
getBigDecimal(int columnIndex)
BigDecimal
getBigDecimal(int columnIndex, int scale)
Deprecated.
BigDecimal
getBigDecimal(java.lang.String columnName)
BigDecimal
getBigDecimal(java.lang.String columnName, int scale)
Deprecated.
InputStream
getBinaryStream(int columnIndex)
InputStream
getBinaryStream(java.lang.String columnName)
Blob
getBlob(int i)
Blob
getBlob(java.lang.String colName)
boolean
getBoolean(int columnIndex)
boolean
getBoolean(java.lang.String columnName)
byte
getByte(int columnIndex)
byte
getByte(java.lang.String columnName)
byte[]
getBytes(int columnIndex)
byte[]
getBytes(java.lang.String columnName)
Reader
getCharacterStream(int columnIndex)
Reader
getCharacterStream(java.lang.String columnName)
Clob
getClob(int i)
Clob
getClob(java.lang.String colName)
int
getConcurrency()
String
getCursorName()
Date
getDate(int columnIndex)
Date
getDate(int columnIndex, Calendar cal)
Date
getDate(java.lang.String columnName)
Date
getDate(java.lang.String columnName, Calendar cal)
ResultSet
getDelegate()
double
getDouble(int columnIndex)
double
getDouble(java.lang.String columnName)
int
getFetchDirection()
int
getFetchSize()
float
getFloat(int columnIndex)
float
getFloat(java.lang.String columnName)
ResultSet
getInnermostDelegate()
If my underlying ResultSet is not a DelegatingResultSet, returns it, otherwise recursively invokes this method on my delegate.
int
getInt(int columnIndex)
int
getInt(java.lang.String columnName)
long
getLong(int columnIndex)
long
getLong(java.lang.String columnName)
ResultSetMetaData
getMetaData()
Object
getObject(int columnIndex)
Object
getObject(int i, Map map)
Object
getObject(java.lang.String columnName)
Object
getObject(java.lang.String colName, Map map)
Ref
getRef(int i)
Ref
getRef(java.lang.String colName)
int
getRow()
short
getShort(int columnIndex)
short
getShort(java.lang.String columnName)
Statement
getStatement()
String
getString(int columnIndex)
String
getString(java.lang.String columnName)
Time
getTime(int columnIndex)
Time
getTime(int columnIndex, Calendar cal)
Time
getTime(java.lang.String columnName)
Time
getTime(java.lang.String columnName, Calendar cal)
Timestamp
getTimestamp(int columnIndex)
Timestamp
getTimestamp(int columnIndex, Calendar cal)
Timestamp
getTimestamp(java.lang.String columnName)
Timestamp
getTimestamp(java.lang.String columnName, Calendar cal)
int
getType()
URL
getURL(int columnIndex)
URL
getURL(java.lang.String columnName)
InputStream
getUnicodeStream(int columnIndex)
Deprecated.
InputStream
getUnicodeStream(java.lang.String columnName)
Deprecated.
SQLWarning
getWarnings()
int
hashCode()
void
insertRow()
boolean
isAfterLast()
boolean
isBeforeFirst()
boolean
isFirst()
boolean
isLast()
boolean
last()
void
moveToCurrentRow()
void
moveToInsertRow()
boolean
next()
boolean
previous()
void
refreshRow()
boolean
relative(int rows)
boolean
rowDeleted()
boolean
rowInserted()
boolean
rowUpdated()
void
setFetchDirection(int direction)
void
setFetchSize(int rows)
void
updateArray(int columnIndex, Array x)
void
updateArray(java.lang.String columnName, Array x)
void
updateAsciiStream(int columnIndex, InputStream x, int length)
void
updateAsciiStream(java.lang.String columnName, InputStream x, int length)
void
updateBigDecimal(int columnIndex, BigDecimal x)
void
updateBigDecimal(java.lang.String columnName, BigDecimal x)
void
updateBinaryStream(int columnIndex, InputStream x, int length)
void
updateBinaryStream(java.lang.String columnName, InputStream x, int length)
void
updateBlob(int columnIndex, Blob x)
void
updateBlob(java.lang.String columnName, Blob x)
void
updateBoolean(int columnIndex, boolean x)
void
updateBoolean(java.lang.String columnName, boolean x)
void
updateByte(int columnIndex, byte x)
void
updateByte(java.lang.String columnName, byte x)
void
updateBytes(int columnIndex, byte[] x)
void
updateBytes(java.lang.String columnName, byte[] x)
void
updateCharacterStream(int columnIndex, Reader x, int length)
void
updateCharacterStream(java.lang.String columnName, Reader reader, int length)
void
updateClob(int columnIndex, Clob x)
void
updateClob(java.lang.String columnName, Clob x)
void
updateDate(int columnIndex, Date x)
void
updateDate(java.lang.String columnName, Date x)
void
updateDouble(int columnIndex, double x)
void
updateDouble(java.lang.String columnName, double x)
void
updateFloat(int columnIndex, float x)
void
updateFloat(java.lang.String columnName, float x)
void
updateInt(int columnIndex, int x)
void
updateInt(java.lang.String columnName, int x)
void
updateLong(int columnIndex, long x)
void
updateLong(java.lang.String columnName, long x)
void
updateNull(int columnIndex)
void
updateNull(java.lang.String columnName)
void
updateObject(int columnIndex, Object x)
void
updateObject(int columnIndex, Object x, int scale)
void
updateObject(java.lang.String columnName, Object x)
void
updateObject(java.lang.String columnName, Object x, int scale)
void
updateRef(int columnIndex, Ref x)
void
updateRef(java.lang.String columnName, Ref x)
void
updateRow()
void
updateShort(int columnIndex, short x)
void
updateShort(java.lang.String columnName, short x)
void
updateString(int columnIndex, java.lang.String x)
void
updateString(java.lang.String columnName, java.lang.String x)
void
updateTime(int columnIndex, Time x)
void
updateTime(java.lang.String columnName, Time x)
void
updateTimestamp(int columnIndex, Timestamp x)
void
updateTimestamp(java.lang.String columnName, Timestamp x)
boolean
wasNull()
static ResultSet
wrapResultSet(Statement stmt, ResultSet rset)

Methods inherited from class org.apache.commons.dbcp.AbandonedTrace

printStackTrace

Constructor Details

DelegatingResultSet

public DelegatingResultSet(Statement stmt,
                           ResultSet res)
Create a wrapper for the ResultSet which traces this ResultSet to the Statement which created it and the code which created it.

Parameters:

Method Details

absolute

public boolean absolute(int row)
            throws SQLException


afterLast

public void afterLast()
            throws SQLException


beforeFirst

public void beforeFirst()
            throws SQLException


cancelRowUpdates

public void cancelRowUpdates()
            throws SQLException


clearWarnings

public void clearWarnings()
            throws SQLException


close

public void close()
            throws SQLException
Wrapper for close of ResultSet which removes this result set from being traced then calls close on the original ResultSet.


deleteRow

public void deleteRow()
            throws SQLException


equals

public boolean equals(Object obj)


findColumn

public int findColumn(java.lang.String columnName)
            throws SQLException


first

public boolean first()
            throws SQLException


getArray

public Array getArray(int i)
            throws SQLException


getArray

public Array getArray(java.lang.String colName)
            throws SQLException


getAsciiStream

public InputStream getAsciiStream(int columnIndex)
            throws SQLException


getAsciiStream

public InputStream getAsciiStream(java.lang.String columnName)
            throws SQLException


getBigDecimal

public BigDecimal getBigDecimal(int columnIndex)
            throws SQLException


getBigDecimal

public BigDecimal getBigDecimal(int columnIndex,
                                          int scale)
            throws SQLException

Deprecated.


getBigDecimal

public BigDecimal getBigDecimal(java.lang.String columnName)
            throws SQLException


getBigDecimal

public BigDecimal getBigDecimal(java.lang.String columnName,
                                          int scale)
            throws SQLException

Deprecated.


getBinaryStream

public InputStream getBinaryStream(int columnIndex)
            throws SQLException


getBinaryStream

public InputStream getBinaryStream(java.lang.String columnName)
            throws SQLException


getBlob

public Blob getBlob(int i)
            throws SQLException


getBlob

public Blob getBlob(java.lang.String colName)
            throws SQLException


getBoolean

public boolean getBoolean(int columnIndex)
            throws SQLException


getBoolean

public boolean getBoolean(java.lang.String columnName)
            throws SQLException


getByte

public byte getByte(int columnIndex)
            throws SQLException


getByte

public byte getByte(java.lang.String columnName)
            throws SQLException


getBytes

public byte[] getBytes(int columnIndex)
            throws SQLException


getBytes

public byte[] getBytes(java.lang.String columnName)
            throws SQLException


getCharacterStream

public Reader getCharacterStream(int columnIndex)
            throws SQLException


getCharacterStream

public Reader getCharacterStream(java.lang.String columnName)
            throws SQLException


getClob

public Clob getClob(int i)
            throws SQLException


getClob

public Clob getClob(java.lang.String colName)
            throws SQLException


getConcurrency

public int getConcurrency()
            throws SQLException


getCursorName

public String getCursorName()
            throws SQLException


getDate

public Date getDate(int columnIndex)
            throws SQLException


getDate

public Date getDate(int columnIndex,
                             Calendar cal)
            throws SQLException


getDate

public Date getDate(java.lang.String columnName)
            throws SQLException


getDate

public Date getDate(java.lang.String columnName,
                             Calendar cal)
            throws SQLException


getDelegate

public ResultSet getDelegate()


getDouble

public double getDouble(int columnIndex)
            throws SQLException


getDouble

public double getDouble(java.lang.String columnName)
            throws SQLException


getFetchDirection

public int getFetchDirection()
            throws SQLException


getFetchSize

public int getFetchSize()
            throws SQLException


getFloat

public float getFloat(int columnIndex)
            throws SQLException


getFloat

public float getFloat(java.lang.String columnName)
            throws SQLException


getInnermostDelegate

public ResultSet getInnermostDelegate()
If my underlying ResultSet is not a DelegatingResultSet, returns it, otherwise recursively invokes this method on my delegate.

Hence this method will return the first delegate that is not a DelegatingResultSet, or null when no non-DelegatingResultSet delegate can be found by transversing this chain.

This method is useful when you may have nested DelegatingResultSets, and you want to make sure to obtain a "genuine" ResultSet.


getInt

public int getInt(int columnIndex)
            throws SQLException


getInt

public int getInt(java.lang.String columnName)
            throws SQLException


getLong

public long getLong(int columnIndex)
            throws SQLException


getLong

public long getLong(java.lang.String columnName)
            throws SQLException


getMetaData

public ResultSetMetaData getMetaData()
            throws SQLException


getObject

public Object getObject(int columnIndex)
            throws SQLException


getObject

public Object getObject(int i,
                                  Map map)
            throws SQLException


getObject

public Object getObject(java.lang.String columnName)
            throws SQLException


getObject

public Object getObject(java.lang.String colName,
                                  Map map)
            throws SQLException


getRef

public Ref getRef(int i)
            throws SQLException


getRef

public Ref getRef(java.lang.String colName)
            throws SQLException


getRow

public int getRow()
            throws SQLException


getShort

public short getShort(int columnIndex)
            throws SQLException


getShort

public short getShort(java.lang.String columnName)
            throws SQLException


getStatement

public Statement getStatement()
            throws SQLException


getString

public String getString(int columnIndex)
            throws SQLException


getString

public String getString(java.lang.String columnName)
            throws SQLException


getTime

public Time getTime(int columnIndex)
            throws SQLException


getTime

public Time getTime(int columnIndex,
                             Calendar cal)
            throws SQLException


getTime

public Time getTime(java.lang.String columnName)
            throws SQLException


getTime

public Time getTime(java.lang.String columnName,
                             Calendar cal)
            throws SQLException


getTimestamp

public Timestamp getTimestamp(int columnIndex)
            throws SQLException


getTimestamp

public Timestamp getTimestamp(int columnIndex,
                                       Calendar cal)
            throws SQLException


getTimestamp

public Timestamp getTimestamp(java.lang.String columnName)
            throws SQLException


getTimestamp

public Timestamp getTimestamp(java.lang.String columnName,
                                       Calendar cal)
            throws SQLException


getType

public int getType()
            throws SQLException


getURL

public URL getURL(int columnIndex)
            throws SQLException


getURL

public URL getURL(java.lang.String columnName)
            throws SQLException


getUnicodeStream

public InputStream getUnicodeStream(int columnIndex)
            throws SQLException

Deprecated.


getUnicodeStream

public InputStream getUnicodeStream(java.lang.String columnName)
            throws SQLException

Deprecated.


getWarnings

public SQLWarning getWarnings()
            throws SQLException


hashCode

public int hashCode()


insertRow

public void insertRow()
            throws SQLException


isAfterLast

public boolean isAfterLast()
            throws SQLException


isBeforeFirst

public boolean isBeforeFirst()
            throws SQLException


isFirst

public boolean isFirst()
            throws SQLException


isLast

public boolean isLast()
            throws SQLException


last

public boolean last()
            throws SQLException


moveToCurrentRow

public void moveToCurrentRow()
            throws SQLException


moveToInsertRow

public void moveToInsertRow()
            throws SQLException


next

public boolean next()
            throws SQLException


previous

public boolean previous()
            throws SQLException


refreshRow

public void refreshRow()
            throws SQLException


relative

public boolean relative(int rows)
            throws SQLException


rowDeleted

public boolean rowDeleted()
            throws SQLException


rowInserted

public boolean rowInserted()
            throws SQLException


rowUpdated

public boolean rowUpdated()
            throws SQLException


setFetchDirection

public void setFetchDirection(int direction)
            throws SQLException


setFetchSize

public void setFetchSize(int rows)
            throws SQLException


updateArray

public void updateArray(int columnIndex,
                        Array x)
            throws SQLException


updateArray

public void updateArray(java.lang.String columnName,
                        Array x)
            throws SQLException


updateAsciiStream

public void updateAsciiStream(int columnIndex,
                              InputStream x,
                              int length)
            throws SQLException


updateAsciiStream

public void updateAsciiStream(java.lang.String columnName,
                              InputStream x,
                              int length)
            throws SQLException


updateBigDecimal

public void updateBigDecimal(int columnIndex,
                             BigDecimal x)
            throws SQLException


updateBigDecimal

public void updateBigDecimal(java.lang.String columnName,
                             BigDecimal x)
            throws SQLException


updateBinaryStream

public void updateBinaryStream(int columnIndex,
                               InputStream x,
                               int length)
            throws SQLException


updateBinaryStream

public void updateBinaryStream(java.lang.String columnName,
                               InputStream x,
                               int length)
            throws SQLException


updateBlob

public void updateBlob(int columnIndex,
                       Blob x)
            throws SQLException


updateBlob

public void updateBlob(java.lang.String columnName,
                       Blob x)
            throws SQLException


updateBoolean

public void updateBoolean(int columnIndex,
                          boolean x)
            throws SQLException


updateBoolean

public void updateBoolean(java.lang.String columnName,
                          boolean x)
            throws SQLException


updateByte

public void updateByte(int columnIndex,
                       byte x)
            throws SQLException


updateByte

public void updateByte(java.lang.String columnName,
                       byte x)
            throws SQLException


updateBytes

public void updateBytes(int columnIndex,
                        byte[] x)
            throws SQLException


updateBytes

public void updateBytes(java.lang.String columnName,
                        byte[] x)
            throws SQLException


updateCharacterStream

public void updateCharacterStream(int columnIndex,
                                  Reader x,
                                  int length)
            throws SQLException


updateCharacterStream

public void updateCharacterStream(java.lang.String columnName,
                                  Reader reader,
                                  int length)
            throws SQLException


updateClob

public void updateClob(int columnIndex,
                       Clob x)
            throws SQLException


updateClob

public void updateClob(java.lang.String columnName,
                       Clob x)
            throws SQLException


updateDate

public void updateDate(int columnIndex,
                       Date x)
            throws SQLException


updateDate

public void updateDate(java.lang.String columnName,
                       Date x)
            throws SQLException


updateDouble

public void updateDouble(int columnIndex,
                         double x)
            throws SQLException


updateDouble

public void updateDouble(java.lang.String columnName,
                         double x)
            throws SQLException


updateFloat

public void updateFloat(int columnIndex,
                        float x)
            throws SQLException


updateFloat

public void updateFloat(java.lang.String columnName,
                        float x)
            throws SQLException


updateInt

public void updateInt(int columnIndex,
                      int x)
            throws SQLException


updateInt

public void updateInt(java.lang.String columnName,
                      int x)
            throws SQLException


updateLong

public void updateLong(int columnIndex,
                       long x)
            throws SQLException


updateLong

public void updateLong(java.lang.String columnName,
                       long x)
            throws SQLException


updateNull

public void updateNull(int columnIndex)
            throws SQLException


updateNull

public void updateNull(java.lang.String columnName)
            throws SQLException


updateObject

public void updateObject(int columnIndex,
                         Object x)
            throws SQLException


updateObject

public void updateObject(int columnIndex,
                         Object x,
                         int scale)
            throws SQLException


updateObject

public void updateObject(java.lang.String columnName,
                         Object x)
            throws SQLException


updateObject

public void updateObject(java.lang.String columnName,
                         Object x,
                         int scale)
            throws SQLException


updateRef

public void updateRef(int columnIndex,
                      Ref x)
            throws SQLException


updateRef

public void updateRef(java.lang.String columnName,
                      Ref x)
            throws SQLException


updateRow

public void updateRow()
            throws SQLException


updateShort

public void updateShort(int columnIndex,
                        short x)
            throws SQLException


updateShort

public void updateShort(java.lang.String columnName,
                        short x)
            throws SQLException


updateString

public void updateString(int columnIndex,
                         java.lang.String x)
            throws SQLException


updateString

public void updateString(java.lang.String columnName,
                         java.lang.String x)
            throws SQLException


updateTime

public void updateTime(int columnIndex,
                       Time x)
            throws SQLException


updateTime

public void updateTime(java.lang.String columnName,
                       Time x)
            throws SQLException


updateTimestamp

public void updateTimestamp(int columnIndex,
                            Timestamp x)
            throws SQLException


updateTimestamp

public void updateTimestamp(java.lang.String columnName,
                            Timestamp x)
            throws SQLException


wasNull

public boolean wasNull()
            throws SQLException


wrapResultSet

public static ResultSet wrapResultSet(Statement stmt,
                                               ResultSet rset)


Copyright © 2001-2003 Apache Software Foundation. Documenation generated February 28 2005.