org.apache.commons.dbcp

Class DelegatingResultSet

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 $

Author: 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
booleanabsolute(int row)
voidafterLast()
voidbeforeFirst()
voidcancelRowUpdates()
voidclearWarnings()
voidclose()
Wrapper for close of ResultSet which removes this result set from being traced then calls close on the original ResultSet.
voiddeleteRow()
booleanequals(Object obj)
intfindColumn(String columnName)
booleanfirst()
ArraygetArray(int i)
ArraygetArray(String colName)
InputStreamgetAsciiStream(int columnIndex)
InputStreamgetAsciiStream(String columnName)
BigDecimalgetBigDecimal(int columnIndex, int scale)
BigDecimalgetBigDecimal(String columnName, int scale)
BigDecimalgetBigDecimal(int columnIndex)
BigDecimalgetBigDecimal(String columnName)
InputStreamgetBinaryStream(int columnIndex)
InputStreamgetBinaryStream(String columnName)
BlobgetBlob(int i)
BlobgetBlob(String colName)
booleangetBoolean(int columnIndex)
booleangetBoolean(String columnName)
bytegetByte(int columnIndex)
bytegetByte(String columnName)
byte[]getBytes(int columnIndex)
byte[]getBytes(String columnName)
ReadergetCharacterStream(int columnIndex)
ReadergetCharacterStream(String columnName)
ClobgetClob(int i)
ClobgetClob(String colName)
intgetConcurrency()
StringgetCursorName()
DategetDate(int columnIndex)
DategetDate(String columnName)
DategetDate(int columnIndex, Calendar cal)
DategetDate(String columnName, Calendar cal)
ResultSetgetDelegate()
doublegetDouble(int columnIndex)
doublegetDouble(String columnName)
intgetFetchDirection()
intgetFetchSize()
floatgetFloat(int columnIndex)
floatgetFloat(String columnName)
ResultSetgetInnermostDelegate()
If my underlying ResultSet is not a DelegatingResultSet, returns it, otherwise recursively invokes this method on my delegate.
intgetInt(int columnIndex)
intgetInt(String columnName)
longgetLong(int columnIndex)
longgetLong(String columnName)
ResultSetMetaDatagetMetaData()
ObjectgetObject(int columnIndex)
ObjectgetObject(String columnName)
ObjectgetObject(int i, Map map)
ObjectgetObject(String colName, Map map)
RefgetRef(int i)
RefgetRef(String colName)
intgetRow()
shortgetShort(int columnIndex)
shortgetShort(String columnName)
StatementgetStatement()
StringgetString(int columnIndex)
StringgetString(String columnName)
TimegetTime(int columnIndex)
TimegetTime(String columnName)
TimegetTime(int columnIndex, Calendar cal)
TimegetTime(String columnName, Calendar cal)
TimestampgetTimestamp(int columnIndex)
TimestampgetTimestamp(String columnName)
TimestampgetTimestamp(int columnIndex, Calendar cal)
TimestampgetTimestamp(String columnName, Calendar cal)
intgetType()
InputStreamgetUnicodeStream(int columnIndex)
InputStreamgetUnicodeStream(String columnName)
URLgetURL(int columnIndex)
URLgetURL(String columnName)
SQLWarninggetWarnings()
inthashCode()
voidinsertRow()
booleanisAfterLast()
booleanisBeforeFirst()
booleanisFirst()
booleanisLast()
booleanlast()
voidmoveToCurrentRow()
voidmoveToInsertRow()
booleannext()
booleanprevious()
voidrefreshRow()
booleanrelative(int rows)
booleanrowDeleted()
booleanrowInserted()
booleanrowUpdated()
voidsetFetchDirection(int direction)
voidsetFetchSize(int rows)
voidupdateArray(int columnIndex, Array x)
voidupdateArray(String columnName, Array x)
voidupdateAsciiStream(int columnIndex, InputStream x, int length)
voidupdateAsciiStream(String columnName, InputStream x, int length)
voidupdateBigDecimal(int columnIndex, BigDecimal x)
voidupdateBigDecimal(String columnName, BigDecimal x)
voidupdateBinaryStream(int columnIndex, InputStream x, int length)
voidupdateBinaryStream(String columnName, InputStream x, int length)
voidupdateBlob(int columnIndex, Blob x)
voidupdateBlob(String columnName, Blob x)
voidupdateBoolean(int columnIndex, boolean x)
voidupdateBoolean(String columnName, boolean x)
voidupdateByte(int columnIndex, byte x)
voidupdateByte(String columnName, byte x)
voidupdateBytes(int columnIndex, byte[] x)
voidupdateBytes(String columnName, byte[] x)
voidupdateCharacterStream(int columnIndex, Reader x, int length)
voidupdateCharacterStream(String columnName, Reader reader, int length)
voidupdateClob(int columnIndex, Clob x)
voidupdateClob(String columnName, Clob x)
voidupdateDate(int columnIndex, Date x)
voidupdateDate(String columnName, Date x)
voidupdateDouble(int columnIndex, double x)
voidupdateDouble(String columnName, double x)
voidupdateFloat(int columnIndex, float x)
voidupdateFloat(String columnName, float x)
voidupdateInt(int columnIndex, int x)
voidupdateInt(String columnName, int x)
voidupdateLong(int columnIndex, long x)
voidupdateLong(String columnName, long x)
voidupdateNull(int columnIndex)
voidupdateNull(String columnName)
voidupdateObject(int columnIndex, Object x, int scale)
voidupdateObject(int columnIndex, Object x)
voidupdateObject(String columnName, Object x, int scale)
voidupdateObject(String columnName, Object x)
voidupdateRef(int columnIndex, Ref x)
voidupdateRef(String columnName, Ref x)
voidupdateRow()
voidupdateShort(int columnIndex, short x)
voidupdateShort(String columnName, short x)
voidupdateString(int columnIndex, String x)
voidupdateString(String columnName, String x)
voidupdateTime(int columnIndex, Time x)
voidupdateTime(String columnName, Time x)
voidupdateTimestamp(int columnIndex, Timestamp x)
voidupdateTimestamp(String columnName, Timestamp x)
booleanwasNull()
static ResultSetwrapResultSet(Statement stmt, ResultSet rset)

Constructor Detail

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: Statement stmt which create this ResultSet ResultSet to wrap

Method Detail

absolute

public boolean absolute(int row)

afterLast

public void afterLast()

beforeFirst

public void beforeFirst()

cancelRowUpdates

public void cancelRowUpdates()

clearWarnings

public void clearWarnings()

close

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

deleteRow

public void deleteRow()

equals

public boolean equals(Object obj)

findColumn

public int findColumn(String columnName)

first

public boolean first()

getArray

public Array getArray(int i)

getArray

public Array getArray(String colName)

getAsciiStream

public InputStream getAsciiStream(int columnIndex)

getAsciiStream

public InputStream getAsciiStream(String columnName)

getBigDecimal

public BigDecimal getBigDecimal(int columnIndex, int scale)

Deprecated:

getBigDecimal

public BigDecimal getBigDecimal(String columnName, int scale)

Deprecated:

getBigDecimal

public BigDecimal getBigDecimal(int columnIndex)

getBigDecimal

public BigDecimal getBigDecimal(String columnName)

getBinaryStream

public InputStream getBinaryStream(int columnIndex)

getBinaryStream

public InputStream getBinaryStream(String columnName)

getBlob

public Blob getBlob(int i)

getBlob

public Blob getBlob(String colName)

getBoolean

public boolean getBoolean(int columnIndex)

getBoolean

public boolean getBoolean(String columnName)

getByte

public byte getByte(int columnIndex)

getByte

public byte getByte(String columnName)

getBytes

public byte[] getBytes(int columnIndex)

getBytes

public byte[] getBytes(String columnName)

getCharacterStream

public Reader getCharacterStream(int columnIndex)

getCharacterStream

public Reader getCharacterStream(String columnName)

getClob

public Clob getClob(int i)

getClob

public Clob getClob(String colName)

getConcurrency

public int getConcurrency()

getCursorName

public String getCursorName()

getDate

public Date getDate(int columnIndex)

getDate

public Date getDate(String columnName)

getDate

public Date getDate(int columnIndex, Calendar cal)

getDate

public Date getDate(String columnName, Calendar cal)

getDelegate

public ResultSet getDelegate()

getDouble

public double getDouble(int columnIndex)

getDouble

public double getDouble(String columnName)

getFetchDirection

public int getFetchDirection()

getFetchSize

public int getFetchSize()

getFloat

public float getFloat(int columnIndex)

getFloat

public float getFloat(String columnName)

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)

getInt

public int getInt(String columnName)

getLong

public long getLong(int columnIndex)

getLong

public long getLong(String columnName)

getMetaData

public ResultSetMetaData getMetaData()

getObject

public Object getObject(int columnIndex)

getObject

public Object getObject(String columnName)

getObject

public Object getObject(int i, Map map)

getObject

public Object getObject(String colName, Map map)

getRef

public Ref getRef(int i)

getRef

public Ref getRef(String colName)

getRow

public int getRow()

getShort

public short getShort(int columnIndex)

getShort

public short getShort(String columnName)

getStatement

public Statement getStatement()

getString

public String getString(int columnIndex)

getString

public String getString(String columnName)

getTime

public Time getTime(int columnIndex)

getTime

public Time getTime(String columnName)

getTime

public Time getTime(int columnIndex, Calendar cal)

getTime

public Time getTime(String columnName, Calendar cal)

getTimestamp

public Timestamp getTimestamp(int columnIndex)

getTimestamp

public Timestamp getTimestamp(String columnName)

getTimestamp

public Timestamp getTimestamp(int columnIndex, Calendar cal)

getTimestamp

public Timestamp getTimestamp(String columnName, Calendar cal)

getType

public int getType()

getUnicodeStream

public InputStream getUnicodeStream(int columnIndex)

Deprecated:

getUnicodeStream

public InputStream getUnicodeStream(String columnName)

Deprecated:

getURL

public URL getURL(int columnIndex)

getURL

public URL getURL(String columnName)

getWarnings

public SQLWarning getWarnings()

hashCode

public int hashCode()

insertRow

public void insertRow()

isAfterLast

public boolean isAfterLast()

isBeforeFirst

public boolean isBeforeFirst()

isFirst

public boolean isFirst()

isLast

public boolean isLast()

last

public boolean last()

moveToCurrentRow

public void moveToCurrentRow()

moveToInsertRow

public void moveToInsertRow()

next

public boolean next()

previous

public boolean previous()

refreshRow

public void refreshRow()

relative

public boolean relative(int rows)

rowDeleted

public boolean rowDeleted()

rowInserted

public boolean rowInserted()

rowUpdated

public boolean rowUpdated()

setFetchDirection

public void setFetchDirection(int direction)

setFetchSize

public void setFetchSize(int rows)

updateArray

public void updateArray(int columnIndex, Array x)

updateArray

public void updateArray(String columnName, Array x)

updateAsciiStream

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

updateAsciiStream

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

updateBigDecimal

public void updateBigDecimal(int columnIndex, BigDecimal x)

updateBigDecimal

public void updateBigDecimal(String columnName, BigDecimal x)

updateBinaryStream

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

updateBinaryStream

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

updateBlob

public void updateBlob(int columnIndex, Blob x)

updateBlob

public void updateBlob(String columnName, Blob x)

updateBoolean

public void updateBoolean(int columnIndex, boolean x)

updateBoolean

public void updateBoolean(String columnName, boolean x)

updateByte

public void updateByte(int columnIndex, byte x)

updateByte

public void updateByte(String columnName, byte x)

updateBytes

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

updateBytes

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

updateCharacterStream

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

updateCharacterStream

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

updateClob

public void updateClob(int columnIndex, Clob x)

updateClob

public void updateClob(String columnName, Clob x)

updateDate

public void updateDate(int columnIndex, Date x)

updateDate

public void updateDate(String columnName, Date x)

updateDouble

public void updateDouble(int columnIndex, double x)

updateDouble

public void updateDouble(String columnName, double x)

updateFloat

public void updateFloat(int columnIndex, float x)

updateFloat

public void updateFloat(String columnName, float x)

updateInt

public void updateInt(int columnIndex, int x)

updateInt

public void updateInt(String columnName, int x)

updateLong

public void updateLong(int columnIndex, long x)

updateLong

public void updateLong(String columnName, long x)

updateNull

public void updateNull(int columnIndex)

updateNull

public void updateNull(String columnName)

updateObject

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

updateObject

public void updateObject(int columnIndex, Object x)

updateObject

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

updateObject

public void updateObject(String columnName, Object x)

updateRef

public void updateRef(int columnIndex, Ref x)

updateRef

public void updateRef(String columnName, Ref x)

updateRow

public void updateRow()

updateShort

public void updateShort(int columnIndex, short x)

updateShort

public void updateShort(String columnName, short x)

updateString

public void updateString(int columnIndex, String x)

updateString

public void updateString(String columnName, String x)

updateTime

public void updateTime(int columnIndex, Time x)

updateTime

public void updateTime(String columnName, Time x)

updateTimestamp

public void updateTimestamp(int columnIndex, Timestamp x)

updateTimestamp

public void updateTimestamp(String columnName, Timestamp x)

wasNull

public boolean wasNull()

wrapResultSet

public static ResultSet wrapResultSet(Statement stmt, ResultSet rset)
Copyright © 2001-2003 Apache Software Foundation. Documenation generated February 19 2008.