com.ibatis.sqlmap.client.extensions
Interface ParameterSetter

All Known Implementing Classes:
ParameterSetterImpl

public interface ParameterSetter

Allows parameters to be set on the underlying prepared statement. TypeHandlerCallback implementations use this interface to process values before they are set on the prepared statement. Each of these methods has a corresponding method on the PreparedStatement class, the only difference being that there is no need to specify the parameter index with these methods.

NOTE: There is no need to implement this. The implementation will be passed into the TypeHandlerCallback automatically.


Method Summary
 int getParameterIndex()
          Returns the index of the parameter being set.
 PreparedStatement getPreparedStatement()
          Returns the underlying prepared statement...be careful!
 void setArray(Array x)
          Set an array on the underlying prepared statement
 void setAsciiStream(InputStream x, int length)
          Set an InputStream on the underlying prepared statement
 void setBigDecimal(BigDecimal x)
          Set an on the underlying prepared statement
 void setBinaryStream(InputStream x, int length)
          Set an InputStream on the underlying prepared statement
 void setBlob(Blob x)
          Set a blob on the underlying prepared statement
 void setBoolean(boolean x)
          Set a boolean on the underlying prepared statement
 void setByte(byte x)
          Set a byte on the underlying prepared statement
 void setBytes(byte[] x)
          Set a byte array on the underlying prepared statement
 void setCharacterStream(Reader reader, int length)
          Set a character stream on the underlying prepared statement
 void setClob(Clob x)
          Set a clob on the underlying prepared statement
 void setDate(Date x)
          Set a date on the underlying prepared statement
 void setDate(Date x, Calendar cal)
          Set a date with a calendar on the underlying prepared statement
 void setDouble(double x)
          Set a double on the underlying prepared statement
 void setFloat(float x)
          Set a float on the underlying prepared statement
 void setInt(int x)
          Set an integer on the underlying prepared statement
 void setLong(long x)
          Set a long on the underlying prepared statement
 void setNull(int sqlType)
          Set a null on the underlying prepared statement
 void setNull(int sqlType, String typeName)
          Set a null on the underlying prepared statement
 void setObject(Object x)
          Set an object on the underlying prepared statement
 void setObject(Object x, int targetSqlType)
          Set an object on the underlying prepared statement
 void setObject(Object x, int targetSqlType, int scale)
          Set an object on the underlying prepared statement
 void setRef(Ref x)
          Set a reference on the underlying prepared statement
 void setShort(short x)
          Set a short on the underlying prepared statement
 void setString(String x)
          Set a string on the underlying prepared statement
 void setTime(Time x)
          Set a time on the underlying prepared statement
 void setTime(Time x, Calendar cal)
          Set a time with a calendar on the underlying prepared statement
 void setTimestamp(Timestamp x)
          Set a timestamp on the underlying prepared statement
 void setTimestamp(Timestamp x, Calendar cal)
          Set a timestamp on the underlying prepared statement
 void setURL(URL x)
          Set a URL on the underlying prepared statement
 

Method Detail

setArray

void setArray(Array x)
              throws SQLException
Set an array on the underlying prepared statement

Parameters:
x - - the array to set
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setAsciiStream

void setAsciiStream(InputStream x,
                    int length)
                    throws SQLException
Set an InputStream on the underlying prepared statement

Parameters:
x - - the InputStream
length - - the length of the InputStream
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setBigDecimal

void setBigDecimal(BigDecimal x)
                   throws SQLException
Set an on the underlying prepared statement

Parameters:
x -
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setBinaryStream

void setBinaryStream(InputStream x,
                     int length)
                     throws SQLException
Set an InputStream on the underlying prepared statement

Parameters:
x - - the InputStream
length - - the length of the InputStream
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setBlob

void setBlob(Blob x)
             throws SQLException
Set a blob on the underlying prepared statement

Parameters:
x - - the blob
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setBoolean

void setBoolean(boolean x)
                throws SQLException
Set a boolean on the underlying prepared statement

Parameters:
x - - the boolean
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setByte

void setByte(byte x)
             throws SQLException
Set a byte on the underlying prepared statement

Parameters:
x - - the byte
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setBytes

void setBytes(byte[] x)
              throws SQLException
Set a byte array on the underlying prepared statement

Parameters:
x - - the byte[]
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setCharacterStream

void setCharacterStream(Reader reader,
                        int length)
                        throws SQLException
Set a character stream on the underlying prepared statement

Parameters:
reader - - the reader
length - - the length of the reader
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setClob

void setClob(Clob x)
             throws SQLException
Set a clob on the underlying prepared statement

Parameters:
x - - the clob
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setDate

void setDate(Date x)
             throws SQLException
Set a date on the underlying prepared statement

Parameters:
x - - the date
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setDate

void setDate(Date x,
             Calendar cal)
             throws SQLException
Set a date with a calendar on the underlying prepared statement

Parameters:
x - - the date
cal - - the calendar
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setDouble

void setDouble(double x)
               throws SQLException
Set a double on the underlying prepared statement

Parameters:
x - - the double
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setFloat

void setFloat(float x)
              throws SQLException
Set a float on the underlying prepared statement

Parameters:
x - the float
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setInt

void setInt(int x)
            throws SQLException
Set an integer on the underlying prepared statement

Parameters:
x - - the int
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setLong

void setLong(long x)
             throws SQLException
Set a long on the underlying prepared statement

Parameters:
x - - the long
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setNull

void setNull(int sqlType)
             throws SQLException
Set a null on the underlying prepared statement

Parameters:
sqlType - - the type for the null value
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setNull

void setNull(int sqlType,
             String typeName)
             throws SQLException
Set a null on the underlying prepared statement

Parameters:
sqlType - - the type for the null value
typeName - - the name of the type
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setObject

void setObject(Object x)
               throws SQLException
Set an object on the underlying prepared statement

Parameters:
x - - the object to set
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setObject

void setObject(Object x,
               int targetSqlType)
               throws SQLException
Set an object on the underlying prepared statement

Parameters:
x - - the object to set
targetSqlType - - the sql type of the object
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setObject

void setObject(Object x,
               int targetSqlType,
               int scale)
               throws SQLException
Set an object on the underlying prepared statement

Parameters:
x - - the object to set
targetSqlType - - the sql type of the object
scale - - the scale of the object
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setRef

void setRef(Ref x)
            throws SQLException
Set a reference on the underlying prepared statement

Parameters:
x - - the reference to set
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setShort

void setShort(short x)
              throws SQLException
Set a short on the underlying prepared statement

Parameters:
x - - the short to set
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setString

void setString(String x)
               throws SQLException
Set a string on the underlying prepared statement

Parameters:
x - - the string to set
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setTime

void setTime(Time x)
             throws SQLException
Set a time on the underlying prepared statement

Parameters:
x - - the time to set
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setTime

void setTime(Time x,
             Calendar cal)
             throws SQLException
Set a time with a calendar on the underlying prepared statement

Parameters:
x - - the time to set
cal - - the calendar to use
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setTimestamp

void setTimestamp(Timestamp x)
                  throws SQLException
Set a timestamp on the underlying prepared statement

Parameters:
x - - the timestamp to set
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setTimestamp

void setTimestamp(Timestamp x,
                  Calendar cal)
                  throws SQLException
Set a timestamp on the underlying prepared statement

Parameters:
x - - the timestamp to set
cal - - the calendar to use
Throws:
SQLException - - thrown if the underlying prepared statement throws it

setURL

void setURL(URL x)
            throws SQLException
Set a URL on the underlying prepared statement

Parameters:
x - - the url to set
Throws:
SQLException - - thrown if the underlying prepared statement throws it

getPreparedStatement

PreparedStatement getPreparedStatement()
Returns the underlying prepared statement...be careful!


getParameterIndex

int getParameterIndex()
Returns the index of the parameter being set.

Returns:
the parameter index used to set the value in the underlying PreparedStatement


Copyright © 2010. All Rights Reserved.