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

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(String columnName)
boolean
first()
Array
getArray(String colName)
Array
getArray(int i)
InputStream
getAsciiStream(String columnName)
InputStream
getAsciiStream(int columnIndex)
BigDecimal
getBigDecimal(String columnName)
BigDecimal
getBigDecimal(String columnName, int scale)
Deprecated.
BigDecimal
getBigDecimal(int columnIndex)
BigDecimal
getBigDecimal(int columnIndex, int scale)
Deprecated.
InputStream
getBinaryStream(String columnName)
InputStream
getBinaryStream(int columnIndex)
Blob
getBlob(String colName)
Blob
getBlob(int i)
boolean
getBoolean(String columnName)
boolean
getBoolean(int columnIndex)
byte
getByte(String columnName)
byte
getByte(int columnIndex)
byte[]
getBytes(String columnName)
byte[]
getBytes(int columnIndex)
Reader
getCharacterStream(String columnName)
Reader
getCharacterStream(int columnIndex)
Clob
getClob(String colName)
Clob
getClob(int i)
int
getConcurrency()
String
getCursorName()
Date
getDate(String columnName)
Date
getDate(String columnName, Calendar cal)
Date
getDate(int columnIndex)
Date
getDate(int columnIndex, Calendar cal)
ResultSet
getDelegate()
double
getDouble(String columnName)
double
getDouble(int columnIndex)
int
getFetchDirection()
int
getFetchSize()
float
getFloat(String columnName)
float
getFloat(int columnIndex)
ResultSet
getInnermostDelegate()
If my underlying ResultSet is not a DelegatingResultSet, returns it, otherwise recursively invokes this method on my delegate.
int
getInt(String columnName)
int
getInt(int columnIndex)
long
getLong(String columnName)
long
getLong(int columnIndex)
ResultSetMetaData
getMetaData()
Object
getObject(String columnName)
Object
getObject(String colName, Map map)
Object
getObject(int columnIndex)
Object
getObject(int i, Map map)
Ref
getRef(String colName)
Ref
getRef(int i)
int
getRow()
short
getShort(String columnName)
short
getShort(int columnIndex)
Statement
getStatement()
String
getString(String columnName)
String
getString(int columnIndex)
Time
getTime(String columnName)
Time
getTime(String columnName, Calendar cal)
Time
getTime(int columnIndex)
Time
getTime(int columnIndex, Calendar cal)
Timestamp
getTimestamp(String columnName)
Timestamp
getTimestamp(String columnName, Calendar cal)
Timestamp
getTimestamp(int columnIndex)
Timestamp
getTimestamp(int columnIndex, Calendar cal)
int
getType()
URL
getURL(String columnName)
URL
getURL(int columnIndex)
InputStream
getUnicodeStream(String columnName)
Deprecated.
InputStream
getUnicodeStream(int columnIndex)
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(String columnName, Array x)
void
updateArray(int columnIndex, Array x)
void
updateAsciiStream(String columnName, InputStream x, int length)
void
updateAsciiStream(int columnIndex, InputStream x, int length)
void
updateBigDecimal(String columnName, BigDecimal x)
void
updateBigDecimal(int columnIndex, BigDecimal x)
void
updateBinaryStream(String columnName, InputStream x, int length)
void
updateBinaryStream(int columnIndex, InputStream x, int length)
void
updateBlob(String columnName, Blob x)
void
updateBlob(int columnIndex, Blob x)
void
updateBoolean(String columnName, boolean x)
void
updateBoolean(int columnIndex, boolean x)
void
updateByte(String columnName, byte x)
void
updateByte(int columnIndex, byte x)
void
updateBytes(String columnName, byte[] x)
void
updateBytes(int columnIndex, byte[] x)
void
updateCharacterStream(String columnName, Reader reader, int length)
void
updateCharacterStream(int columnIndex, Reader x, int length)
void
updateClob(String columnName, Clob x)
void
updateClob(int columnIndex, Clob x)
void
updateDate(String columnName, Date x)
void
updateDate(int columnIndex, Date x)
void
updateDouble(String columnName, double x)
void
updateDouble(int columnIndex, double x)
void
updateFloat(String columnName, float x)
void
updateFloat(int columnIndex, float x)
void
updateInt(String columnName, int x)
void
updateInt(int columnIndex, int x)
void
updateLong(String columnName, long x)
void
updateLong(int columnIndex, long x)
void
updateNull(String columnName)
void
updateNull(int columnIndex)
void
updateObject(String columnName, Object x)
void
updateObject(String columnName, Object x, int scale)
void
updateObject(int columnIndex, Object x)
void
updateObject(int columnIndex, Object x, int scale)
void
updateRef(String columnName, Ref x)
void
updateRef(int columnIndex, Ref x)
void
updateRow()
void
updateShort(String columnName, short x)
void
updateShort(int columnIndex, short x)
void
updateString(String columnName, String x)
void
updateString(int columnIndex, String x)
void
updateTime(String columnName, Time x)
void
updateTime(int columnIndex, Time x)
void
updateTimestamp(String columnName, Timestamp x)
void
updateTimestamp(int columnIndex, 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(String columnName)
            throws SQLException

first

public boolean first()
            throws SQLException

getArray

public Array getArray(String colName)
            throws SQLException

getArray

public Array getArray(int i)
            throws SQLException

getAsciiStream

public InputStream getAsciiStream(String columnName)
            throws SQLException

getAsciiStream

public InputStream getAsciiStream(int columnIndex)
            throws SQLException

getBigDecimal

public BigDecimal getBigDecimal(String columnName)
            throws SQLException

getBigDecimal

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

Deprecated.


getBigDecimal

public BigDecimal getBigDecimal(int columnIndex)
            throws SQLException

getBigDecimal

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

Deprecated.


getBinaryStream

public InputStream getBinaryStream(String columnName)
            throws SQLException

getBinaryStream

public InputStream getBinaryStream(int columnIndex)
            throws SQLException

getBlob

public Blob getBlob(String colName)
            throws SQLException

getBlob

public Blob getBlob(int i)
            throws SQLException

getBoolean

public boolean getBoolean(String columnName)
            throws SQLException

getBoolean

public boolean getBoolean(int columnIndex)
            throws SQLException

getByte

public byte getByte(String columnName)
            throws SQLException

getByte

public byte getByte(int columnIndex)
            throws SQLException

getBytes

public byte[] getBytes(String columnName)
            throws SQLException

getBytes

public byte[] getBytes(int columnIndex)
            throws SQLException

getCharacterStream

public Reader getCharacterStream(String columnName)
            throws SQLException

getCharacterStream

public Reader getCharacterStream(int columnIndex)
            throws SQLException

getClob

public Clob getClob(String colName)
            throws SQLException

getClob

public Clob getClob(int i)
            throws SQLException

getConcurrency

public int getConcurrency()
            throws SQLException

getCursorName

public String getCursorName()
            throws SQLException

getDate

public Date getDate(String columnName)
            throws SQLException

getDate

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

getDate

public Date getDate(int columnIndex)
            throws SQLException

getDate

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

getDelegate

public ResultSet getDelegate()

getDouble

public double getDouble(String columnName)
            throws SQLException

getDouble

public double getDouble(int columnIndex)
            throws SQLException

getFetchDirection

public int getFetchDirection()
            throws SQLException

getFetchSize

public int getFetchSize()
            throws SQLException

getFloat

public float getFloat(String columnName)
            throws SQLException

getFloat

public float getFloat(int columnIndex)
            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(String columnName)
            throws SQLException

getInt

public int getInt(int columnIndex)
            throws SQLException

getLong

public long getLong(String columnName)
            throws SQLException

getLong

public long getLong(int columnIndex)
            throws SQLException

getMetaData

public ResultSetMetaData getMetaData()
            throws SQLException

getObject

public Object getObject(String columnName)
            throws SQLException

getObject

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

getObject

public Object getObject(int columnIndex)
            throws SQLException

getObject

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

getRef

public Ref getRef(String colName)
            throws SQLException

getRef

public Ref getRef(int i)
            throws SQLException

getRow

public int getRow()
            throws SQLException

getShort

public short getShort(String columnName)
            throws SQLException

getShort

public short getShort(int columnIndex)
            throws SQLException

getStatement

public Statement getStatement()
            throws SQLException

getString

public String getString(String columnName)
            throws SQLException

getString

public String getString(int columnIndex)
            throws SQLException

getTime

public Time getTime(String columnName)
            throws SQLException

getTime

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

getTime

public Time getTime(int columnIndex)
            throws SQLException

getTime

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

getTimestamp

public Timestamp getTimestamp(String columnName)
            throws SQLException

getTimestamp

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

getTimestamp

public Timestamp getTimestamp(int columnIndex)
            throws SQLException

getTimestamp

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

getType

public int getType()
            throws SQLException

getURL

public URL getURL(String columnName)
            throws SQLException

getURL

public URL getURL(int columnIndex)
            throws SQLException

getUnicodeStream

public InputStream getUnicodeStream(String columnName)
            throws SQLException

Deprecated.


getUnicodeStream

public InputStream getUnicodeStream(int columnIndex)
            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(String columnName,
                        Array x)
            throws SQLException

updateArray

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

updateAsciiStream

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

updateAsciiStream

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

updateBigDecimal

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

updateBigDecimal

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

updateBinaryStream

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

updateBinaryStream

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

updateBlob

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

updateBlob

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

updateBoolean

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

updateBoolean

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

updateByte

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

updateByte

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

updateBytes

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

updateBytes

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

updateCharacterStream

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

updateCharacterStream

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

updateClob

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

updateClob

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

updateDate

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

updateDate

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

updateDouble

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

updateDouble

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

updateFloat

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

updateFloat

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

updateInt

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

updateInt

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

updateLong

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

updateLong

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

updateNull

public void updateNull(String columnName)
            throws SQLException

updateNull

public void updateNull(int columnIndex)
            throws SQLException

updateObject

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

updateObject

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

updateObject

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

updateObject

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

updateRef

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

updateRef

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

updateRow

public void updateRow()
            throws SQLException

updateShort

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

updateShort

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

updateString

public void updateString(String columnName,
                         String x)
            throws SQLException

updateString

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

updateTime

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

updateTime

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

updateTimestamp

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

updateTimestamp

public void updateTimestamp(int columnIndex,
                            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 September 15 2007.