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
Modifier and TypeMethodDescriptionint
Returns the index of the parameter being set.Returns the underlying prepared statement...be careful!void
Set an array on the underlying prepared statement.void
setAsciiStream
(InputStream x, int length) Set an InputStream on the underlying prepared statement.void
Set an on the underlying prepared statement.void
setBinaryStream
(InputStream x, int length) Set an InputStream on the underlying prepared statement.void
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
Set a clob on the underlying prepared statement.void
Set a date on the underlying prepared statement.void
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
Set a null on the underlying prepared statement.void
Set an object on the underlying prepared statement.void
Set an object on the underlying prepared statement.void
Set an object on the underlying prepared statement.void
Set a reference on the underlying prepared statement.void
setShort
(short x) Set a short on the underlying prepared statement.void
Set a string on the underlying prepared statement.void
Set a time on the underlying prepared statement.void
Set a time with a calendar on the underlying prepared statement.void
Set a timestamp on the underlying prepared statement.void
setTimestamp
(Timestamp x, Calendar cal) Set a timestamp on the underlying prepared statement.void
Set a URL on the underlying prepared statement.
-
Method Details
-
setArray
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
Set an InputStream on the underlying prepared statement.- Parameters:
x
- - the InputStreamlength
- - the length of the InputStream- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setBigDecimal
Set an on the underlying prepared statement.- Parameters:
x
- the new big decimal- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setBinaryStream
Set an InputStream on the underlying prepared statement.- Parameters:
x
- - the InputStreamlength
- - the length of the InputStream- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setBlob
Set a blob on the underlying prepared statement.- Parameters:
x
- - the blob- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setBoolean
Set a boolean on the underlying prepared statement.- Parameters:
x
- - the boolean- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setByte
Set a byte on the underlying prepared statement.- Parameters:
x
- - the byte- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setBytes
Set a byte array on the underlying prepared statement.- Parameters:
x
- - the byte[]- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setCharacterStream
Set a character stream on the underlying prepared statement.- Parameters:
reader
- - the readerlength
- - the length of the reader- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setClob
Set a clob on the underlying prepared statement.- Parameters:
x
- - the clob- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setDate
Set a date on the underlying prepared statement.- Parameters:
x
- - the date- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setDate
Set a date with a calendar on the underlying prepared statement.- Parameters:
x
- - the datecal
- - the calendar- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setDouble
Set a double on the underlying prepared statement.- Parameters:
x
- - the double- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setFloat
Set a float on the underlying prepared statement.- Parameters:
x
- the float- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setInt
Set an integer on the underlying prepared statement.- Parameters:
x
- - the int- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setLong
Set a long on the underlying prepared statement.- Parameters:
x
- - the long- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setNull
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
Set a null on the underlying prepared statement.- Parameters:
sqlType
- - the type for the null valuetypeName
- - the name of the type- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setObject
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
Set an object on the underlying prepared statement.- Parameters:
x
- - the object to settargetSqlType
- - the sql type of the object- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setObject
Set an object on the underlying prepared statement.- Parameters:
x
- - the object to settargetSqlType
- - the sql type of the objectscale
- - the scale of the object- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setRef
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
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
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
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
Set a time with a calendar on the underlying prepared statement.- Parameters:
x
- - the time to setcal
- - the calendar to use- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setTimestamp
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
Set a timestamp on the underlying prepared statement.- Parameters:
x
- - the timestamp to setcal
- - the calendar to use- Throws:
SQLException
- - thrown if the underlying prepared statement throws it
-
setURL
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!- Returns:
- the prepared statement
-
getParameterIndex
int getParameterIndex()Returns the index of the parameter being set.- Returns:
- the parameter index used to set the value in the underlying PreparedStatement
-