FileDocCategorySizeDatePackage
ResultSetWrapper.javaAPI DocHibernate 3.2.517029Sat Feb 12 00:19:50 GMT 2005org.hibernate.jdbc

ResultSetWrapper

public class ResultSetWrapper extends Object implements ResultSet
A ResultSet delegate, responsible for locally caching the columnName-to-columnIndex resolution that has been found to be inefficient in a few vendor's drivers (i.e., Oracle and Postgres).
author
Steve Ebersole

Fields Summary
private ResultSet
rs
private ColumnNameCache
columnNameCache
Constructors Summary
public ResultSetWrapper(ResultSet resultSet, ColumnNameCache columnNameCache)

		this.rs = resultSet;
		this.columnNameCache = columnNameCache;
	
Methods Summary
public booleanabsolute(int row)

		return rs.absolute(row);
	
public voidafterLast()

		rs.afterLast();
	
public voidbeforeFirst()

		rs.beforeFirst();
	
public voidcancelRowUpdates()

		rs.cancelRowUpdates();
	
public voidclearWarnings()

		rs.clearWarnings();
	
public voidclose()

		rs.close();
	
public voiddeleteRow()

		rs.deleteRow();
	
public intfindColumn(java.lang.String columnName)
Overridden version to utilize local caching of the column indexes by name to improve performance for those drivers which are known to not support such caching by themselves.

This implementation performs the caching based on the upper case version of the given column name.

param
columnName The column name to resolve into an index.
return
The column index corresponding to the given column name.
throws
SQLException - if the ResultSet object does not contain columnName or a database access error occurs

		return columnNameCache.getIndexForColumnName( columnName, this );
	
public booleanfirst()

		return rs.first();
	
public java.sql.ArraygetArray(int columnIndex)

		return rs.getArray(columnIndex);
	
public java.sql.ArraygetArray(java.lang.String colName)

		return rs.getArray( findColumn(colName) );
	
public java.io.InputStreamgetAsciiStream(int columnIndex)

		return rs.getAsciiStream(columnIndex);
	
public java.io.InputStreamgetAsciiStream(java.lang.String columnName)

		return rs.getAsciiStream( findColumn(columnName) );
	
public java.math.BigDecimalgetBigDecimal(int columnIndex)

		return rs.getBigDecimal(columnIndex);
	
public java.math.BigDecimalgetBigDecimal(int columnIndex, int scale)

		return rs.getBigDecimal(columnIndex, scale);
	
public java.math.BigDecimalgetBigDecimal(java.lang.String columnName)

		return rs.getBigDecimal( findColumn(columnName) );
	
public java.math.BigDecimalgetBigDecimal(java.lang.String columnName, int scale)

		return rs.getBigDecimal( findColumn(columnName), scale );
	
public java.io.InputStreamgetBinaryStream(int columnIndex)

		return rs.getBinaryStream(columnIndex);
	
public java.io.InputStreamgetBinaryStream(java.lang.String columnName)

		return rs.getBinaryStream( findColumn(columnName) );
	
public java.sql.BlobgetBlob(int columnIndex)

		return rs.getBlob(columnIndex);
	
public java.sql.BlobgetBlob(java.lang.String columnName)

		return rs.getBlob( findColumn(columnName) );
	
public booleangetBoolean(java.lang.String columnName)

		return rs.getBoolean( findColumn(columnName) );
	
public booleangetBoolean(int columnIndex)

		return rs.getBoolean(columnIndex);
	
public bytegetByte(java.lang.String columnName)

		return rs.getByte( findColumn(columnName) );
	
public bytegetByte(int columnIndex)

		return rs.getByte(columnIndex);
	
public byte[]getBytes(java.lang.String columnName)

		return rs.getBytes( findColumn(columnName) );
	
public byte[]getBytes(int columnIndex)

		return rs.getBytes(columnIndex);
	
public java.io.ReadergetCharacterStream(int columnIndex)

		return rs.getCharacterStream(columnIndex);
	
public java.io.ReadergetCharacterStream(java.lang.String columnName)

		return rs.getCharacterStream( findColumn(columnName) );
	
public java.sql.ClobgetClob(int columnIndex)

		return rs.getClob(columnIndex);
	
public java.sql.ClobgetClob(java.lang.String columnName)

		return rs.getClob( findColumn(columnName) );
	
public intgetConcurrency()

		return rs.getConcurrency();
	
public java.lang.StringgetCursorName()

		return rs.getCursorName();
	
public java.sql.DategetDate(int columnIndex)

		return rs.getDate(columnIndex);
	
public java.sql.DategetDate(int columnIndex, java.util.Calendar cal)

		return rs.getDate(columnIndex, cal);
	
public java.sql.DategetDate(java.lang.String columnName)

		return rs.getDate( findColumn(columnName) );
	
public java.sql.DategetDate(java.lang.String columnName, java.util.Calendar cal)

		return rs.getDate( findColumn(columnName), cal );
	
public doublegetDouble(java.lang.String columnName)

		return rs.getDouble( findColumn(columnName) );
	
public doublegetDouble(int columnIndex)

		return rs.getDouble(columnIndex);
	
public intgetFetchDirection()

		return rs.getFetchDirection();
	
public intgetFetchSize()

		return rs.getFetchSize();
	
public floatgetFloat(java.lang.String columnName)

		return rs.getFloat( findColumn(columnName) );
	
public floatgetFloat(int columnIndex)

		return rs.getFloat(columnIndex);
	
public intgetInt(java.lang.String columnName)

		return rs.getInt( findColumn(columnName) );
	
public intgetInt(int columnIndex)

		return rs.getInt(columnIndex);
	
public longgetLong(java.lang.String columnName)

		return rs.getLong( findColumn(columnName) );
	
public longgetLong(int columnIndex)

		return rs.getLong(columnIndex);
	
public java.sql.ResultSetMetaDatagetMetaData()

		return rs.getMetaData();
	
public java.lang.ObjectgetObject(int columnIndex)

		return rs.getObject(columnIndex);
	
public java.lang.ObjectgetObject(int columnIndex, java.util.Map map)

		return rs.getObject( columnIndex, map );
	
public java.lang.ObjectgetObject(java.lang.String columnName)

		return rs.getObject( findColumn(columnName) );
	
public java.lang.ObjectgetObject(java.lang.String columnName, java.util.Map map)

		return rs.getObject( findColumn(columnName), map );
	
public java.sql.RefgetRef(int columnIndex)

		return rs.getRef(columnIndex);
	
public java.sql.RefgetRef(java.lang.String columnName)

		return rs.getRef( findColumn(columnName) );
	
public intgetRow()

		return rs.getRow();
	
public shortgetShort(java.lang.String columnName)

		return rs.getShort( findColumn(columnName) );
	
public shortgetShort(int columnIndex)

		return rs.getShort(columnIndex);
	
public java.sql.StatementgetStatement()

		return rs.getStatement();
	
public java.lang.StringgetString(int columnIndex)

		return rs.getString(columnIndex);
	
public java.lang.StringgetString(java.lang.String columnName)

		return rs.getString( findColumn(columnName) );
	
java.sql.ResultSetgetTarget()

		return rs;
	
public java.sql.TimegetTime(int columnIndex)

		return rs.getTime(columnIndex);
	
public java.sql.TimegetTime(int columnIndex, java.util.Calendar cal)

		return rs.getTime(columnIndex, cal);
	
public java.sql.TimegetTime(java.lang.String columnName)

		return rs.getTime( findColumn(columnName) );
	
public java.sql.TimegetTime(java.lang.String columnName, java.util.Calendar cal)

		return rs.getTime( findColumn(columnName), cal );
	
public java.sql.TimestampgetTimestamp(int columnIndex)

		return rs.getTimestamp(columnIndex);
	
public java.sql.TimestampgetTimestamp(int columnIndex, java.util.Calendar cal)

		return rs.getTimestamp(columnIndex, cal);
	
public java.sql.TimestampgetTimestamp(java.lang.String columnName)

		return rs.getTimestamp( findColumn(columnName) );
	
public java.sql.TimestampgetTimestamp(java.lang.String columnName, java.util.Calendar cal)

		return rs.getTimestamp( findColumn(columnName), cal );
	
public intgetType()

		return rs.getType();
	
public java.net.URLgetURL(int columnIndex)

		return rs.getURL(columnIndex);
	
public java.net.URLgetURL(java.lang.String columnName)

		return rs.getURL( findColumn(columnName) );
	
public java.io.InputStreamgetUnicodeStream(int columnIndex)

		return rs.getUnicodeStream(columnIndex);
	
public java.io.InputStreamgetUnicodeStream(java.lang.String columnName)

		return rs.getUnicodeStream( findColumn(columnName) );
	
public java.sql.SQLWarninggetWarnings()

		return rs.getWarnings();
	
public voidinsertRow()

		rs.insertRow();
	
public booleanisAfterLast()

		return rs.isAfterLast();
	
public booleanisBeforeFirst()

		return rs.isBeforeFirst();
	
public booleanisFirst()

		return rs.isFirst();
	
public booleanisLast()

		return rs.isLast();
	
public booleanlast()

		return rs.last();
	
public voidmoveToCurrentRow()

		rs.moveToCurrentRow();
	
public voidmoveToInsertRow()

		rs.moveToInsertRow();
	
public booleannext()

		return rs.next();
	
public booleanprevious()

		return rs.previous();
	
public voidrefreshRow()

		rs.refreshRow();
	
public booleanrelative(int rows)

		return rs.relative(rows);
	
public booleanrowDeleted()

		return rs.rowDeleted();
	
public booleanrowInserted()

		return rs.rowInserted();
	
public booleanrowUpdated()

		return rs.rowUpdated();
	
public voidsetFetchDirection(int direction)

		rs.setFetchDirection(direction);
	
public voidsetFetchSize(int rows)

		rs.setFetchSize(rows);
	
public voidupdateArray(int columnIndex, java.sql.Array x)

		rs.updateArray(columnIndex, x);
	
public voidupdateArray(java.lang.String columnName, java.sql.Array x)

		rs.updateArray( findColumn(columnName), x );
	
public voidupdateAsciiStream(int columnIndex, java.io.InputStream x, int length)

		rs.updateAsciiStream(columnIndex, x, length);
	
public voidupdateAsciiStream(java.lang.String columnName, java.io.InputStream x, int length)

		rs.updateAsciiStream( findColumn(columnName), x, length );
	
public voidupdateBigDecimal(java.lang.String columnName, java.math.BigDecimal x)

		rs.updateBigDecimal( findColumn(columnName), x );
	
public voidupdateBigDecimal(int columnIndex, java.math.BigDecimal x)

		rs.updateBigDecimal(columnIndex, x);
	
public voidupdateBinaryStream(int columnIndex, java.io.InputStream x, int length)

		rs.updateBinaryStream(columnIndex, x, length);
	
public voidupdateBinaryStream(java.lang.String columnName, java.io.InputStream x, int length)

		rs.updateBinaryStream( findColumn(columnName), x, length );
	
public voidupdateBlob(int columnIndex, java.sql.Blob x)

		rs.updateBlob(columnIndex, x);
	
public voidupdateBlob(java.lang.String columnName, java.sql.Blob x)

		rs.updateBlob( findColumn(columnName), x );
	
public voidupdateBoolean(int columnIndex, boolean x)

		rs.updateBoolean(columnIndex, x);
	
public voidupdateBoolean(java.lang.String columnName, boolean x)

		rs.updateBoolean( findColumn(columnName), x );
	
public voidupdateByte(java.lang.String columnName, byte x)

		rs.updateByte( findColumn(columnName), x );
	
public voidupdateByte(int columnIndex, byte x)

		rs.updateByte(columnIndex, x);
	
public voidupdateBytes(int columnIndex, byte[] x)

		rs.updateBytes(columnIndex, x);
	
public voidupdateBytes(java.lang.String columnName, byte[] x)

		rs.updateBytes( findColumn(columnName), x );
	
public voidupdateCharacterStream(int columnIndex, java.io.Reader x, int length)

		rs.updateCharacterStream(columnIndex, x, length);
	
public voidupdateCharacterStream(java.lang.String columnName, java.io.Reader x, int length)

		rs.updateCharacterStream( findColumn(columnName), x, length );
	
public voidupdateClob(int columnIndex, java.sql.Clob x)

		rs.updateClob(columnIndex, x);
	
public voidupdateClob(java.lang.String columnName, java.sql.Clob x)

		rs.updateClob( findColumn(columnName), x );
	
public voidupdateDate(int columnIndex, java.sql.Date x)

		rs.updateDate(columnIndex, x);
	
public voidupdateDate(java.lang.String columnName, java.sql.Date x)

		rs.updateDate( findColumn(columnName), x );
	
public voidupdateDouble(java.lang.String columnName, double x)

		rs.updateDouble( findColumn(columnName), x );
	
public voidupdateDouble(int columnIndex, double x)

		rs.updateDouble(columnIndex, x);
	
public voidupdateFloat(java.lang.String columnName, float x)

		rs.updateFloat( findColumn(columnName), x );
	
public voidupdateFloat(int columnIndex, float x)

		rs.updateFloat(columnIndex, x);
	
public voidupdateInt(java.lang.String columnName, int x)

		rs.updateInt( findColumn(columnName), x );
	
public voidupdateInt(int columnIndex, int x)

		rs.updateInt(columnIndex, x);
	
public voidupdateLong(int columnIndex, long x)

		rs.updateLong(columnIndex, x);
	
public voidupdateLong(java.lang.String columnName, long x)

		rs.updateLong( findColumn(columnName), x );
	
public voidupdateNull(java.lang.String columnName)

		rs.updateNull( findColumn(columnName) );
	
public voidupdateNull(int columnIndex)

		rs.updateNull(columnIndex);
	
public voidupdateObject(int columnIndex, java.lang.Object x)

		rs.updateObject(columnIndex, x);
	
public voidupdateObject(int columnIndex, java.lang.Object x, int scale)

		rs.updateObject(columnIndex, x, scale);
	
public voidupdateObject(java.lang.String columnName, java.lang.Object x)

		rs.updateObject( findColumn(columnName), x );
	
public voidupdateObject(java.lang.String columnName, java.lang.Object x, int scale)

		rs.updateObject( findColumn(columnName), x, scale );
	
public voidupdateRef(int columnIndex, java.sql.Ref x)

		rs.updateRef(columnIndex, x);
	
public voidupdateRef(java.lang.String columnName, java.sql.Ref x)

		rs.updateRef( findColumn(columnName), x );
	
public voidupdateRow()

		rs.updateRow();
	
public voidupdateShort(int columnIndex, short x)

		rs.updateShort(columnIndex, x);
	
public voidupdateShort(java.lang.String columnName, short x)

		rs.updateShort( findColumn(columnName), x );
	
public voidupdateString(int columnIndex, java.lang.String x)

		rs.updateString(columnIndex, x);
	
public voidupdateString(java.lang.String columnName, java.lang.String x)

		rs.updateString( findColumn(columnName), x );
	
public voidupdateTime(int columnIndex, java.sql.Time x)

		rs.updateTime(columnIndex, x);
	
public voidupdateTime(java.lang.String columnName, java.sql.Time x)

		rs.updateTime( findColumn(columnName), x );
	
public voidupdateTimestamp(int columnIndex, java.sql.Timestamp x)

		rs.updateTimestamp(columnIndex, x);
	
public voidupdateTimestamp(java.lang.String columnName, java.sql.Timestamp x)

		rs.updateTimestamp( findColumn(columnName), x );
	
public booleanwasNull()

		return rs.wasNull();