com.ibatis.sqlmap.client.extensions

Interface ParameterSetter

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
intgetParameterIndex()
Returns the index of the parameter being set.
PreparedStatementgetPreparedStatement()
Returns the underlying prepared statement...be careful!
voidsetArray(Array x)
Set an array on the underlying prepared statement
voidsetAsciiStream(InputStream x, int length)
Set an InputStream on the underlying prepared statement
voidsetBigDecimal(BigDecimal x)
Set an on the underlying prepared statement
voidsetBinaryStream(InputStream x, int length)
Set an InputStream on the underlying prepared statement
voidsetBlob(Blob x)
Set a blob on the underlying prepared statement
voidsetBoolean(boolean x)
Set a boolean on the underlying prepared statement
voidsetByte(byte x)
Set a byte on the underlying prepared statement
voidsetBytes(byte[] x)
Set a byte array on the underlying prepared statement
voidsetCharacterStream(Reader reader, int length)
Set a character stream on the underlying prepared statement
voidsetClob(Clob x)
Set a clob on the underlying prepared statement
voidsetDate(Date x)
Set a date on the underlying prepared statement
voidsetDate(Date x, Calendar cal)
Set a date with a calendar on the underlying prepared statement
voidsetDouble(double x)
Set a double on the underlying prepared statement
voidsetFloat(float x)
Set a float on the underlying prepared statement
voidsetInt(int x)
Set an integer on the underlying prepared statement
voidsetLong(long x)
Set a long on the underlying prepared statement
voidsetNull(int sqlType)
Set a null on the underlying prepared statement
voidsetNull(int sqlType, String typeName)
Set a null on the underlying prepared statement
voidsetObject(Object x)
Set an object on the underlying prepared statement
voidsetObject(Object x, int targetSqlType)
Set an object on the underlying prepared statement
voidsetObject(Object x, int targetSqlType, int scale)
Set an object on the underlying prepared statement
voidsetRef(Ref x)
Set a reference on the underlying prepared statement
voidsetShort(short x)
Set a short on the underlying prepared statement
voidsetString(String x)
Set a string on the underlying prepared statement
voidsetTime(Time x)
Set a time on the underlying prepared statement
voidsetTime(Time x, Calendar cal)
Set a time with a calendar on the underlying prepared statement
voidsetTimestamp(Timestamp x)
Set a timestamp on the underlying prepared statement
voidsetTimestamp(Timestamp x, Calendar cal)
Set a timestamp on the underlying prepared statement
voidsetURL(URL x)
Set a URL on the underlying prepared statement

Method Detail

getParameterIndex

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

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

getPreparedStatement

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

setArray

public void setArray(Array x)
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

public void setAsciiStream(InputStream x, int length)
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

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

Parameters: x

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

setBinaryStream

public void setBinaryStream(InputStream x, int length)
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

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

Parameters: x - the blob

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

setBoolean

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

Parameters: x - the boolean

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

setByte

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

Parameters: x - the byte

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

setBytes

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

Parameters: x - the byte[]

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

setCharacterStream

public void setCharacterStream(Reader reader, int length)
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

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

Parameters: x - the clob

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

setDate

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

Parameters: x - the date

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

setDate

public void setDate(Date x, Calendar cal)
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

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

Parameters: x - the double

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

setFloat

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

Parameters: x the float

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

setInt

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

Parameters: x - the int

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

setLong

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

Parameters: x - the long

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

setNull

public void setNull(int sqlType)
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

public void setNull(int sqlType, String typeName)
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

public void setObject(Object x)
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

public void setObject(Object x, int targetSqlType)
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

public void setObject(Object x, int targetSqlType, int scale)
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

public void setRef(Ref x)
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

public void setShort(short x)
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

public void setString(String x)
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

public void setTime(Time x)
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

public void setTime(Time x, Calendar cal)
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

public void setTimestamp(Timestamp x)
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

public void setTimestamp(Timestamp x, Calendar cal)
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

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

Parameters: x - the url to set

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

Copyright © 2011. All Rights Reserved.