com.ibatis.sqlmap.engine.type
Class ResultGetterImpl

java.lang.Object
  extended bycom.ibatis.sqlmap.engine.type.ResultGetterImpl
All Implemented Interfaces:
ResultGetter

public class ResultGetterImpl
extends java.lang.Object
implements ResultGetter

A ResultGetter implementation


Constructor Summary
ResultGetterImpl(java.sql.ResultSet resultSet, int columnIndex)
          Creates an instance for a PreparedStatement and column index
ResultGetterImpl(java.sql.ResultSet resultSet, java.lang.String columnName)
          Creates an instance for a PreparedStatement and column name
 
Method Summary
 java.sql.Array getArray()
          Gets an array from the underlying result set
 java.math.BigDecimal getBigDecimal()
          Gets a BigDecimal from the underlying result set
 java.sql.Blob getBlob()
          Gets a Blob from the underlying result set
 boolean getBoolean()
          Gets a boolean from the underlying result set
 byte getByte()
          Gets a byte from the underlying result set
 byte[] getBytes()
          Gets a byte[] from the underlying result set
 java.sql.Clob getClob()
          Gets a Clob from the underlying result set
 int getColumnIndex()
          Returns the index of the column being got in the underlying ResultSet.
 java.lang.String getColumnName()
          Returns the name of the column being got in the underlying ResultSet.
 java.sql.Date getDate()
          Gets a Date from the underlying result set
 java.sql.Date getDate(java.util.Calendar cal)
          Gets a Date from the underlying result set using a calendar
 double getDouble()
          Gets a double from the underlying result set
 float getFloat()
          Gets a float from the underlying result set
 int getInt()
          Gets an int from the underlying result set
 long getLong()
          Gets a long from the underlying result set
 java.lang.Object getObject()
          Gets an Object from the underlying result set
 java.lang.Object getObject(java.util.Map map)
          Gets an Object from the underlying result set using a Map
 java.sql.Ref getRef()
          Gets a Ref from the underlying result set
 java.sql.ResultSet getResultSet()
          Returns the underlying ResultSet...be careful!
 short getShort()
          Gets a short from the underlying result set
 java.lang.String getString()
          Gets a String from the underlying result set
 java.sql.Time getTime()
          Gets a Time from the underlying result set
 java.sql.Time getTime(java.util.Calendar cal)
          Gets a Time from the underlying result set using a Calendar
 java.sql.Timestamp getTimestamp()
          Gets a Timestamp from the underlying result set
 java.sql.Timestamp getTimestamp(java.util.Calendar cal)
          Gets a Timestamp from the underlying result set
 java.net.URL getURL()
          Gets a URL from the underlying result set
 boolean wasNull()
          Tells if the field was null
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultGetterImpl

public ResultGetterImpl(java.sql.ResultSet resultSet,
                        int columnIndex)
Creates an instance for a PreparedStatement and column index

Parameters:
resultSet - - the result set
columnIndex - - the column index

ResultGetterImpl

public ResultGetterImpl(java.sql.ResultSet resultSet,
                        java.lang.String columnName)
Creates an instance for a PreparedStatement and column name

Parameters:
resultSet - - the result set
columnName - - the column index
Method Detail

getArray

public java.sql.Array getArray()
                        throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets an array from the underlying result set

Specified by:
getArray in interface ResultGetter
Returns:
- the array
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getBigDecimal

public java.math.BigDecimal getBigDecimal()
                                   throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a BigDecimal from the underlying result set

Specified by:
getBigDecimal in interface ResultGetter
Returns:
- the BigDecimal
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getBlob

public java.sql.Blob getBlob()
                      throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a Blob from the underlying result set

Specified by:
getBlob in interface ResultGetter
Returns:
- the Blob
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getBoolean

public boolean getBoolean()
                   throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a boolean from the underlying result set

Specified by:
getBoolean in interface ResultGetter
Returns:
- the boolean
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getByte

public byte getByte()
             throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a byte from the underlying result set

Specified by:
getByte in interface ResultGetter
Returns:
- the byte
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getBytes

public byte[] getBytes()
                throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a byte[] from the underlying result set

Specified by:
getBytes in interface ResultGetter
Returns:
- the byte[]
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getClob

public java.sql.Clob getClob()
                      throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a Clob from the underlying result set

Specified by:
getClob in interface ResultGetter
Returns:
- the Clob
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getDate

public java.sql.Date getDate()
                      throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a Date from the underlying result set

Specified by:
getDate in interface ResultGetter
Returns:
- the Date
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getDate

public java.sql.Date getDate(java.util.Calendar cal)
                      throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a Date from the underlying result set using a calendar

Specified by:
getDate in interface ResultGetter
Parameters:
cal - - the Calendar
Returns:
- the Date
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getDouble

public double getDouble()
                 throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a double from the underlying result set

Specified by:
getDouble in interface ResultGetter
Returns:
- the double
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getFloat

public float getFloat()
               throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a float from the underlying result set

Specified by:
getFloat in interface ResultGetter
Returns:
- the float
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getInt

public int getInt()
           throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets an int from the underlying result set

Specified by:
getInt in interface ResultGetter
Returns:
- the int
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getLong

public long getLong()
             throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a long from the underlying result set

Specified by:
getLong in interface ResultGetter
Returns:
- the long
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getObject

public java.lang.Object getObject()
                           throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets an Object from the underlying result set

Specified by:
getObject in interface ResultGetter
Returns:
- the Object
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getObject

public java.lang.Object getObject(java.util.Map map)
                           throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets an Object from the underlying result set using a Map

Specified by:
getObject in interface ResultGetter
Parameters:
map - - the Map
Returns:
- the Object
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getRef

public java.sql.Ref getRef()
                    throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a Ref from the underlying result set

Specified by:
getRef in interface ResultGetter
Returns:
- the Ref
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getShort

public short getShort()
               throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a short from the underlying result set

Specified by:
getShort in interface ResultGetter
Returns:
- the short
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getString

public java.lang.String getString()
                           throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a String from the underlying result set

Specified by:
getString in interface ResultGetter
Returns:
- the String
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getTime

public java.sql.Time getTime()
                      throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a Time from the underlying result set

Specified by:
getTime in interface ResultGetter
Returns:
- the Time
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getTime

public java.sql.Time getTime(java.util.Calendar cal)
                      throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a Time from the underlying result set using a Calendar

Specified by:
getTime in interface ResultGetter
Parameters:
cal - - the Calendar
Returns:
- the Time
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getTimestamp

public java.sql.Timestamp getTimestamp()
                                throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a Timestamp from the underlying result set

Specified by:
getTimestamp in interface ResultGetter
Returns:
- the Timestamp
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getTimestamp

public java.sql.Timestamp getTimestamp(java.util.Calendar cal)
                                throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a Timestamp from the underlying result set

Specified by:
getTimestamp in interface ResultGetter
Parameters:
cal - - the Calendar
Returns:
- the Timestamp
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getURL

public java.net.URL getURL()
                    throws java.sql.SQLException
Description copied from interface: ResultGetter
Gets a URL from the underlying result set

Specified by:
getURL in interface ResultGetter
Returns:
- the URL
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

wasNull

public boolean wasNull()
                throws java.sql.SQLException
Description copied from interface: ResultGetter
Tells if the field was null

Specified by:
wasNull in interface ResultGetter
Returns:
- true if it was null
Throws:
java.sql.SQLException - - if the underlying result set throws an exception

getResultSet

public java.sql.ResultSet getResultSet()
Description copied from interface: ResultGetter
Returns the underlying ResultSet...be careful!

Specified by:
getResultSet in interface ResultGetter
Returns:
a ResultSet instance.

getColumnIndex

public int getColumnIndex()
Description copied from interface: ResultGetter
Returns the index of the column being got in the underlying ResultSet. Only use this method if the value returned from getColumnName is null.

Specified by:
getColumnIndex in interface ResultGetter
Returns:
the index of the column (if zero then use the column name)

getColumnName

public java.lang.String getColumnName()
Description copied from interface: ResultGetter
Returns the name of the column being got in the underlying ResultSet. May be null in which case the getColumnIndex method should be used.

Specified by:
getColumnName in interface ResultGetter
Returns:
the column name (may be null)