Class ParameterSetterImpl

java.lang.Object
com.ibatis.sqlmap.engine.type.ParameterSetterImpl
All Implemented Interfaces:
ParameterSetter

public class ParameterSetterImpl extends Object implements ParameterSetter
A ParameterSetter implementation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ParameterSetterImpl(PreparedStatement statement, int columnIndex)
    Creates an instance for a PreparedStatement and column index.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    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
    setNull(int sqlType, String typeName)
    Set a null on the underlying prepared statement.
    void
    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
    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
    Set a timestamp on the underlying prepared statement.
    void
    Set a URL on the underlying prepared statement.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ParameterSetterImpl

      public ParameterSetterImpl(PreparedStatement statement, int columnIndex)
      Creates an instance for a PreparedStatement and column index.
      Parameters:
      statement - - the PreparedStatement
      columnIndex - - the column index
  • Method Details

    • setArray

      public void setArray(Array x) throws SQLException
      Description copied from interface: ParameterSetter
      Set an array on the underlying prepared statement.
      Specified by:
      setArray in interface ParameterSetter
      Parameters:
      x - - the array to set
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setAsciiStream

      public void setAsciiStream(InputStream x, int length) throws SQLException
      Description copied from interface: ParameterSetter
      Set an InputStream on the underlying prepared statement.
      Specified by:
      setAsciiStream in interface ParameterSetter
      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) throws SQLException
      Description copied from interface: ParameterSetter
      Set an on the underlying prepared statement.
      Specified by:
      setBigDecimal in interface ParameterSetter
      Parameters:
      x - the new big decimal
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setBinaryStream

      public void setBinaryStream(InputStream x, int length) throws SQLException
      Description copied from interface: ParameterSetter
      Set an InputStream on the underlying prepared statement.
      Specified by:
      setBinaryStream in interface ParameterSetter
      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) throws SQLException
      Description copied from interface: ParameterSetter
      Set a blob on the underlying prepared statement.
      Specified by:
      setBlob in interface ParameterSetter
      Parameters:
      x - - the blob
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setBoolean

      public void setBoolean(boolean x) throws SQLException
      Description copied from interface: ParameterSetter
      Set a boolean on the underlying prepared statement.
      Specified by:
      setBoolean in interface ParameterSetter
      Parameters:
      x - - the boolean
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setByte

      public void setByte(byte x) throws SQLException
      Description copied from interface: ParameterSetter
      Set a byte on the underlying prepared statement.
      Specified by:
      setByte in interface ParameterSetter
      Parameters:
      x - - the byte
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setBytes

      public void setBytes(byte[] x) throws SQLException
      Description copied from interface: ParameterSetter
      Set a byte array on the underlying prepared statement.
      Specified by:
      setBytes in interface ParameterSetter
      Parameters:
      x - - the byte[]
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setCharacterStream

      public void setCharacterStream(Reader reader, int length) throws SQLException
      Description copied from interface: ParameterSetter
      Set a character stream on the underlying prepared statement.
      Specified by:
      setCharacterStream in interface ParameterSetter
      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) throws SQLException
      Description copied from interface: ParameterSetter
      Set a clob on the underlying prepared statement.
      Specified by:
      setClob in interface ParameterSetter
      Parameters:
      x - - the clob
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setDate

      public void setDate(Date x) throws SQLException
      Description copied from interface: ParameterSetter
      Set a date on the underlying prepared statement.
      Specified by:
      setDate in interface ParameterSetter
      Parameters:
      x - - the date
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setDate

      public void setDate(Date x, Calendar cal) throws SQLException
      Description copied from interface: ParameterSetter
      Set a date with a calendar on the underlying prepared statement.
      Specified by:
      setDate in interface ParameterSetter
      Parameters:
      x - - the date
      cal - - the calendar
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setDouble

      public void setDouble(double x) throws SQLException
      Description copied from interface: ParameterSetter
      Set a double on the underlying prepared statement.
      Specified by:
      setDouble in interface ParameterSetter
      Parameters:
      x - - the double
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setFloat

      public void setFloat(float x) throws SQLException
      Description copied from interface: ParameterSetter
      Set a float on the underlying prepared statement.
      Specified by:
      setFloat in interface ParameterSetter
      Parameters:
      x - the float
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setInt

      public void setInt(int x) throws SQLException
      Description copied from interface: ParameterSetter
      Set an integer on the underlying prepared statement.
      Specified by:
      setInt in interface ParameterSetter
      Parameters:
      x - - the int
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setLong

      public void setLong(long x) throws SQLException
      Description copied from interface: ParameterSetter
      Set a long on the underlying prepared statement.
      Specified by:
      setLong in interface ParameterSetter
      Parameters:
      x - - the long
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setNull

      public void setNull(int sqlType) throws SQLException
      Description copied from interface: ParameterSetter
      Set a null on the underlying prepared statement.
      Specified by:
      setNull in interface ParameterSetter
      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) throws SQLException
      Description copied from interface: ParameterSetter
      Set a null on the underlying prepared statement.
      Specified by:
      setNull in interface ParameterSetter
      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) throws SQLException
      Description copied from interface: ParameterSetter
      Set an object on the underlying prepared statement.
      Specified by:
      setObject in interface ParameterSetter
      Parameters:
      x - - the object to set
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setObject

      public void setObject(Object x, int targetSqlType) throws SQLException
      Description copied from interface: ParameterSetter
      Set an object on the underlying prepared statement.
      Specified by:
      setObject in interface ParameterSetter
      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) throws SQLException
      Description copied from interface: ParameterSetter
      Set an object on the underlying prepared statement.
      Specified by:
      setObject in interface ParameterSetter
      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) throws SQLException
      Description copied from interface: ParameterSetter
      Set a reference on the underlying prepared statement.
      Specified by:
      setRef in interface ParameterSetter
      Parameters:
      x - - the reference to set
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setShort

      public void setShort(short x) throws SQLException
      Description copied from interface: ParameterSetter
      Set a short on the underlying prepared statement.
      Specified by:
      setShort in interface ParameterSetter
      Parameters:
      x - - the short to set
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setString

      public void setString(String x) throws SQLException
      Description copied from interface: ParameterSetter
      Set a string on the underlying prepared statement.
      Specified by:
      setString in interface ParameterSetter
      Parameters:
      x - - the string to set
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setTime

      public void setTime(Time x) throws SQLException
      Description copied from interface: ParameterSetter
      Set a time on the underlying prepared statement.
      Specified by:
      setTime in interface ParameterSetter
      Parameters:
      x - - the time to set
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setTime

      public void setTime(Time x, Calendar cal) throws SQLException
      Description copied from interface: ParameterSetter
      Set a time with a calendar on the underlying prepared statement.
      Specified by:
      setTime in interface ParameterSetter
      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) throws SQLException
      Description copied from interface: ParameterSetter
      Set a timestamp on the underlying prepared statement.
      Specified by:
      setTimestamp in interface ParameterSetter
      Parameters:
      x - - the timestamp to set
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • setTimestamp

      public void setTimestamp(Timestamp x, Calendar cal) throws SQLException
      Description copied from interface: ParameterSetter
      Set a timestamp on the underlying prepared statement.
      Specified by:
      setTimestamp in interface ParameterSetter
      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) throws SQLException
      Description copied from interface: ParameterSetter
      Set a URL on the underlying prepared statement.
      Specified by:
      setURL in interface ParameterSetter
      Parameters:
      x - - the url to set
      Throws:
      SQLException - - thrown if the underlying prepared statement throws it
    • getPreparedStatement

      public PreparedStatement getPreparedStatement()
      Description copied from interface: ParameterSetter
      Returns the underlying prepared statement...be careful!
      Specified by:
      getPreparedStatement in interface ParameterSetter
      Returns:
      the prepared statement
    • getParameterIndex

      public int getParameterIndex()
      Description copied from interface: ParameterSetter
      Returns the index of the parameter being set.
      Specified by:
      getParameterIndex in interface ParameterSetter
      Returns:
      the parameter index used to set the value in the underlying PreparedStatement