Package org.h2.jdbc

Class JdbcCallableStatement

java.lang.Object
org.h2.message.TraceObject
All Implemented Interfaces:
AutoCloseable, CallableStatement, PreparedStatement, Statement, Wrapper

public final class JdbcCallableStatement extends JdbcPreparedStatement implements CallableStatement
Represents a callable statement.

Thread safety: the callable statement is not thread-safe. If the same callable statement is used by multiple threads access to it must be synchronized. The single synchronized block must include assignment of parameters, execution of the command and all operations with its result.

 synchronized (call) {
     call.setInt(1, 10);
     try (ResultSet rs = call.executeQuery()) {
         while (rs.next) {
             // Do something
         }
     }
 }
 synchronized (call) {
     call.setInt(1, 15);
     updateCount = call.executeUpdate();
 }
 
  • Method Details

    • executeUpdate

      public int executeUpdate() throws SQLException
      Executes a statement (insert, update, delete, create, drop) and returns the update count. If another result set exists for this statement, this will be closed (even if this statement fails). If auto commit is on, this statement will be committed. If the statement is a DDL statement (create, drop, alter) and does not throw an exception, the current transaction (if any) is committed after executing the statement.
      Specified by:
      executeUpdate in interface PreparedStatement
      Overrides:
      executeUpdate in class JdbcPreparedStatement
      Returns:
      the update count (number of row affected by an insert, update or delete, or 0 if no rows or the statement was a create, drop, commit or rollback)
      Throws:
      SQLException - if this object is closed or invalid
      See Also:
    • executeLargeUpdate

      public long executeLargeUpdate() throws SQLException
      Executes a statement (insert, update, delete, create, drop) and returns the update count. If another result set exists for this statement, this will be closed (even if this statement fails). If auto commit is on, this statement will be committed. If the statement is a DDL statement (create, drop, alter) and does not throw an exception, the current transaction (if any) is committed after executing the statement.
      Specified by:
      executeLargeUpdate in interface PreparedStatement
      Overrides:
      executeLargeUpdate in class JdbcPreparedStatement
      Returns:
      the update count (number of row affected by an insert, update or delete, or 0 if no rows or the statement was a create, drop, commit or rollback)
      Throws:
      SQLException - if this object is closed or invalid
    • registerOutParameter

      public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException
      Registers the given OUT parameter.
      Specified by:
      registerOutParameter in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      sqlType - the data type (Types.x) - ignored
      Throws:
      SQLException
    • registerOutParameter

      public void registerOutParameter(int parameterIndex, int sqlType, String typeName) throws SQLException
      Registers the given OUT parameter.
      Specified by:
      registerOutParameter in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      sqlType - the data type (Types.x) - ignored
      typeName - the SQL type name - ignored
      Throws:
      SQLException
    • registerOutParameter

      public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException
      Registers the given OUT parameter.
      Specified by:
      registerOutParameter in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      sqlType - the data type (Types.x)
      scale - is ignored
      Throws:
      SQLException
    • registerOutParameter

      public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException
      Registers the given OUT parameter.
      Specified by:
      registerOutParameter in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      sqlType - the data type (Types.x) - ignored
      typeName - the SQL type name - ignored
      Throws:
      SQLException
    • registerOutParameter

      public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException
      Registers the given OUT parameter.
      Specified by:
      registerOutParameter in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      sqlType - the data type (Types.x) - ignored
      scale - is ignored
      Throws:
      SQLException
    • registerOutParameter

      public void registerOutParameter(String parameterName, int sqlType) throws SQLException
      Registers the given OUT parameter.
      Specified by:
      registerOutParameter in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      sqlType - the data type (Types.x) - ignored
      Throws:
      SQLException
    • wasNull

      public boolean wasNull() throws SQLException
      Returns whether the last column accessed was null.
      Specified by:
      wasNull in interface CallableStatement
      Returns:
      true if the last column accessed was null
      Throws:
      SQLException
    • getURL

      public URL getURL(int parameterIndex) throws SQLException
      [Not supported]
      Specified by:
      getURL in interface CallableStatement
      Throws:
      SQLException
    • getString

      public String getString(int parameterIndex) throws SQLException
      Returns the value of the specified column as a String.
      Specified by:
      getString in interface CallableStatement
      Parameters:
      parameterIndex - (1,2,...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getBoolean

      public boolean getBoolean(int parameterIndex) throws SQLException
      Returns the value of the specified column as a boolean.
      Specified by:
      getBoolean in interface CallableStatement
      Parameters:
      parameterIndex - (1,2,...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getByte

      public byte getByte(int parameterIndex) throws SQLException
      Returns the value of the specified column as a byte.
      Specified by:
      getByte in interface CallableStatement
      Parameters:
      parameterIndex - (1,2,...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getShort

      public short getShort(int parameterIndex) throws SQLException
      Returns the value of the specified column as a short.
      Specified by:
      getShort in interface CallableStatement
      Parameters:
      parameterIndex - (1,2,...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getInt

      public int getInt(int parameterIndex) throws SQLException
      Returns the value of the specified column as an int.
      Specified by:
      getInt in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getLong

      public long getLong(int parameterIndex) throws SQLException
      Returns the value of the specified column as a long.
      Specified by:
      getLong in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getFloat

      public float getFloat(int parameterIndex) throws SQLException
      Returns the value of the specified column as a float.
      Specified by:
      getFloat in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getDouble

      public double getDouble(int parameterIndex) throws SQLException
      Returns the value of the specified column as a double.
      Specified by:
      getDouble in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getBigDecimal

      @Deprecated public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException
      Deprecated.
      Returns the value of the specified column as a BigDecimal.
      Specified by:
      getBigDecimal in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      scale - is ignored
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getBytes

      public byte[] getBytes(int parameterIndex) throws SQLException
      Returns the value of the specified column as a byte array.
      Specified by:
      getBytes in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getDate

      public Date getDate(int parameterIndex) throws SQLException
      Returns the value of the specified column as a java.sql.Date.

      Usage of this method is discouraged. Use getObject(columnIndex, LocalDate.class) instead.

      Specified by:
      getDate in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getTime

      public Time getTime(int parameterIndex) throws SQLException
      Returns the value of the specified column as a java.sql.Time.

      Usage of this method is discouraged. Use getObject(columnIndex, LocalTime.class) instead.

      Specified by:
      getTime in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getTimestamp

      public Timestamp getTimestamp(int parameterIndex) throws SQLException
      Returns the value of the specified column as a java.sql.Timestamp.

      Usage of this method is discouraged. Use getObject(columnIndex, LocalDateTime.class) instead.

      Specified by:
      getTimestamp in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getObject

      public Object getObject(int parameterIndex) throws SQLException
      Returns a column value as a Java object. The data is de-serialized into a Java object (on the client side).
      Specified by:
      getObject in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value or null
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getBigDecimal

      public BigDecimal getBigDecimal(int parameterIndex) throws SQLException
      Returns the value of the specified column as a BigDecimal.
      Specified by:
      getBigDecimal in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getObject

      public Object getObject(int parameterIndex, Map<String,Class<?>> map) throws SQLException
      [Not supported] Gets a column as a object using the specified type mapping.
      Specified by:
      getObject in interface CallableStatement
      Throws:
      SQLException
    • getRef

      public Ref getRef(int parameterIndex) throws SQLException
      [Not supported] Gets a column as a reference.
      Specified by:
      getRef in interface CallableStatement
      Throws:
      SQLException
    • getBlob

      public Blob getBlob(int parameterIndex) throws SQLException
      Returns the value of the specified column as a Blob.
      Specified by:
      getBlob in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getClob

      public Clob getClob(int parameterIndex) throws SQLException
      Returns the value of the specified column as a Clob.
      Specified by:
      getClob in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getArray

      public Array getArray(int parameterIndex) throws SQLException
      Returns the value of the specified column as an Array.
      Specified by:
      getArray in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getDate

      public Date getDate(int parameterIndex, Calendar cal) throws SQLException
      Returns the value of the specified column as a java.sql.Date using a specified time zone.

      Usage of this method is discouraged. Use getObject(columnIndex, LocalDate.class) instead.

      Specified by:
      getDate in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      cal - the calendar
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getTime

      public Time getTime(int parameterIndex, Calendar cal) throws SQLException
      Returns the value of the specified column as a java.sql.Time using a specified time zone.

      Usage of this method is discouraged. Use getObject(columnIndex, LocalTime.class) instead.

      Specified by:
      getTime in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      cal - the calendar
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getTimestamp

      public Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException
      Returns the value of the specified column as a java.sql.Timestamp using a specified time zone.

      Usage of this method is discouraged. Use getObject(columnIndex, LocalDateTime.class) instead.

      Specified by:
      getTimestamp in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      cal - the calendar
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getURL

      public URL getURL(String parameterName) throws SQLException
      [Not supported]
      Specified by:
      getURL in interface CallableStatement
      Throws:
      SQLException
    • getTimestamp

      public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException
      Returns the value of the specified column as a java.sql.Timestamp using a specified time zone.

      Usage of this method is discouraged. Use getObject(parameterName, LocalDateTime.class) instead.

      Specified by:
      getTimestamp in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      cal - the calendar
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getTime

      public Time getTime(String parameterName, Calendar cal) throws SQLException
      Returns the value of the specified column as a java.sql.Time using a specified time zone.

      Usage of this method is discouraged. Use getObject(parameterName, LocalTime.class) instead.

      Specified by:
      getTime in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      cal - the calendar
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getDate

      public Date getDate(String parameterName, Calendar cal) throws SQLException
      Returns the value of the specified column as a java.sql.Date using a specified time zone.

      Usage of this method is discouraged. Use getObject(parameterName, LocalDate.class) instead.

      Specified by:
      getDate in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      cal - the calendar
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getArray

      public Array getArray(String parameterName) throws SQLException
      Returns the value of the specified column as an Array.
      Specified by:
      getArray in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getClob

      public Clob getClob(String parameterName) throws SQLException
      Returns the value of the specified column as a Clob.
      Specified by:
      getClob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getBlob

      public Blob getBlob(String parameterName) throws SQLException
      Returns the value of the specified column as a Blob.
      Specified by:
      getBlob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getRef

      public Ref getRef(String parameterName) throws SQLException
      [Not supported] Gets a column as a reference.
      Specified by:
      getRef in interface CallableStatement
      Throws:
      SQLException
    • getObject

      public Object getObject(String parameterName, Map<String,Class<?>> map) throws SQLException
      [Not supported] Gets a column as a object using the specified type mapping.
      Specified by:
      getObject in interface CallableStatement
      Throws:
      SQLException
    • getBigDecimal

      public BigDecimal getBigDecimal(String parameterName) throws SQLException
      Returns the value of the specified column as a BigDecimal.
      Specified by:
      getBigDecimal in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getObject

      public Object getObject(String parameterName) throws SQLException
      Returns a column value as a Java object. The data is de-serialized into a Java object (on the client side).
      Specified by:
      getObject in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value or null
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getTimestamp

      public Timestamp getTimestamp(String parameterName) throws SQLException
      Returns the value of the specified column as a java.sql.Timestamp.

      Usage of this method is discouraged. Use getObject(parameterName, LocalDateTime.class) instead.

      Specified by:
      getTimestamp in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getTime

      public Time getTime(String parameterName) throws SQLException
      Returns the value of the specified column as a java.sql.Time.

      Usage of this method is discouraged. Use getObject(parameterName, LocalTime.class) instead.

      Specified by:
      getTime in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getDate

      public Date getDate(String parameterName) throws SQLException
      Returns the value of the specified column as a java.sql.Date.

      Usage of this method is discouraged. Use getObject(parameterName, LocalDate.class) instead.

      Specified by:
      getDate in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
      See Also:
    • getBytes

      public byte[] getBytes(String parameterName) throws SQLException
      Returns the value of the specified column as a byte array.
      Specified by:
      getBytes in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getDouble

      public double getDouble(String parameterName) throws SQLException
      Returns the value of the specified column as a double.
      Specified by:
      getDouble in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getFloat

      public float getFloat(String parameterName) throws SQLException
      Returns the value of the specified column as a float.
      Specified by:
      getFloat in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getLong

      public long getLong(String parameterName) throws SQLException
      Returns the value of the specified column as a long.
      Specified by:
      getLong in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getInt

      public int getInt(String parameterName) throws SQLException
      Returns the value of the specified column as an int.
      Specified by:
      getInt in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getShort

      public short getShort(String parameterName) throws SQLException
      Returns the value of the specified column as a short.
      Specified by:
      getShort in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getByte

      public byte getByte(String parameterName) throws SQLException
      Returns the value of the specified column as a byte.
      Specified by:
      getByte in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getBoolean

      public boolean getBoolean(String parameterName) throws SQLException
      Returns the value of the specified column as a boolean.
      Specified by:
      getBoolean in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getString

      public String getString(String parameterName) throws SQLException
      Returns the value of the specified column as a String.
      Specified by:
      getString in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getRowId

      public RowId getRowId(int parameterIndex) throws SQLException
      [Not supported] Returns the value of the specified column as a row id.
      Specified by:
      getRowId in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Throws:
      SQLException
    • getRowId

      public RowId getRowId(String parameterName) throws SQLException
      [Not supported] Returns the value of the specified column as a row id.
      Specified by:
      getRowId in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Throws:
      SQLException
    • getNClob

      public NClob getNClob(int parameterIndex) throws SQLException
      Returns the value of the specified column as a Clob.
      Specified by:
      getNClob in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getNClob

      public NClob getNClob(String parameterName) throws SQLException
      Returns the value of the specified column as a Clob.
      Specified by:
      getNClob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getSQLXML

      public SQLXML getSQLXML(int parameterIndex) throws SQLException
      Returns the value of the specified column as a SQLXML object.
      Specified by:
      getSQLXML in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getSQLXML

      public SQLXML getSQLXML(String parameterName) throws SQLException
      Returns the value of the specified column as a SQLXML object.
      Specified by:
      getSQLXML in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getNString

      public String getNString(int parameterIndex) throws SQLException
      Returns the value of the specified column as a String.
      Specified by:
      getNString in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getNString

      public String getNString(String parameterName) throws SQLException
      Returns the value of the specified column as a String.
      Specified by:
      getNString in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getNCharacterStream

      public Reader getNCharacterStream(int parameterIndex) throws SQLException
      Returns the value of the specified column as a reader.
      Specified by:
      getNCharacterStream in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getNCharacterStream

      public Reader getNCharacterStream(String parameterName) throws SQLException
      Returns the value of the specified column as a reader.
      Specified by:
      getNCharacterStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getCharacterStream

      public Reader getCharacterStream(int parameterIndex) throws SQLException
      Returns the value of the specified column as a reader.
      Specified by:
      getCharacterStream in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getCharacterStream

      public Reader getCharacterStream(String parameterName) throws SQLException
      Returns the value of the specified column as a reader.
      Specified by:
      getCharacterStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • setNull

      public void setNull(String parameterName, int sqlType, String typeName) throws SQLException
      Sets a parameter to null.
      Specified by:
      setNull in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      sqlType - the data type (Types.x)
      typeName - this parameter is ignored
      Throws:
      SQLException - if this object is closed
    • setNull

      public void setNull(String parameterName, int sqlType) throws SQLException
      Sets a parameter to null.
      Specified by:
      setNull in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      sqlType - the data type (Types.x)
      Throws:
      SQLException - if this object is closed
    • setTimestamp

      public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException
      Sets the timestamp using a specified time zone. The value will be converted to the local time zone.

      Usage of this method is discouraged. Use setObject(parameterName, value) with LocalDateTime parameter instead.

      Specified by:
      setTimestamp in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      cal - the calendar
      Throws:
      SQLException - if this object is closed
      See Also:
    • setTime

      public void setTime(String parameterName, Time x, Calendar cal) throws SQLException
      Sets the time using a specified time zone. The value will be converted to the local time zone.

      Usage of this method is discouraged. Use setObject(parameterName, value) with LocalTime parameter instead.

      Specified by:
      setTime in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      cal - the calendar
      Throws:
      SQLException - if this object is closed
      See Also:
    • setDate

      public void setDate(String parameterName, Date x, Calendar cal) throws SQLException
      Sets the date using a specified time zone. The value will be converted to the local time zone.

      Usage of this method is discouraged. Use setObject(parameterName, value) with LocalDate parameter instead.

      Specified by:
      setDate in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      cal - the calendar
      Throws:
      SQLException - if this object is closed
      See Also:
    • setCharacterStream

      public void setCharacterStream(String parameterName, Reader x, int length) throws SQLException
      Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.
      Specified by:
      setCharacterStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      length - the maximum number of characters
      Throws:
      SQLException - if this object is closed
    • setObject

      public void setObject(String parameterName, Object x) throws SQLException
      Sets the value of a parameter. Objects of unknown classes are serialized (on the client side).
      Specified by:
      setObject in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setObject

      public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException
      Sets the value of a parameter. The object is converted, if required, to the specified data type before sending to the database. Objects of unknown classes are serialized (on the client side).
      Specified by:
      setObject in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value, null is allowed
      targetSqlType - the type as defined in java.sql.Types
      Throws:
      SQLException - if this object is closed
    • setObject

      public void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException
      Sets the value of a parameter. The object is converted, if required, to the specified data type before sending to the database. Objects of unknown classes are serialized (on the client side).
      Specified by:
      setObject in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value, null is allowed
      targetSqlType - the type as defined in java.sql.Types
      scale - is ignored
      Throws:
      SQLException - if this object is closed
    • setObject

      public void setObject(String parameterName, Object x, SQLType targetSqlType) throws SQLException
      Sets the value of a parameter. The object is converted, if required, to the specified data type before sending to the database. Objects of unknown classes are serialized (on the client side).
      Specified by:
      setObject in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value, null is allowed
      targetSqlType - the type
      Throws:
      SQLException - if this object is closed
    • setObject

      public void setObject(String parameterName, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException
      Sets the value of a parameter. The object is converted, if required, to the specified data type before sending to the database. Objects of unknown classes are serialized (on the client side).
      Specified by:
      setObject in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value, null is allowed
      targetSqlType - the type
      scaleOrLength - is ignored
      Throws:
      SQLException - if this object is closed
    • setBinaryStream

      public void setBinaryStream(String parameterName, InputStream x, int length) throws SQLException
      Sets the value of a parameter as an input stream. This method does not close the stream. The stream may be closed after executing the statement.
      Specified by:
      setBinaryStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      length - the maximum number of bytes
      Throws:
      SQLException - if this object is closed
    • setAsciiStream

      public void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException
      Sets the value of a parameter as an ASCII stream. This method does not close the stream. The stream may be closed after executing the statement.
      Specified by:
      setAsciiStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      length - the maximum number of bytes
      Throws:
      SQLException - if this object is closed
    • setTimestamp

      public void setTimestamp(String parameterName, Timestamp x) throws SQLException
      Sets the value of a parameter.

      Usage of this method is discouraged. Use setObject(parameterName, value) with LocalDateTime parameter instead.

      Specified by:
      setTimestamp in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
      See Also:
    • setTime

      public void setTime(String parameterName, Time x) throws SQLException
      Sets the time using a specified time zone.

      Usage of this method is discouraged. Use setObject(parameterName, value) with LocalTime parameter instead.

      Specified by:
      setTime in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
      See Also:
    • setDate

      public void setDate(String parameterName, Date x) throws SQLException
      Sets the value of a parameter.

      Usage of this method is discouraged. Use setObject(parameterName, value) with LocalDate parameter instead.

      Specified by:
      setDate in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
      See Also:
    • setBytes

      public void setBytes(String parameterName, byte[] x) throws SQLException
      Sets the value of a parameter as a byte array.
      Specified by:
      setBytes in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setString

      public void setString(String parameterName, String x) throws SQLException
      Sets the value of a parameter.
      Specified by:
      setString in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setBigDecimal

      public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException
      Sets the value of a parameter.
      Specified by:
      setBigDecimal in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setDouble

      public void setDouble(String parameterName, double x) throws SQLException
      Sets the value of a parameter.
      Specified by:
      setDouble in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setFloat

      public void setFloat(String parameterName, float x) throws SQLException
      Sets the value of a parameter.
      Specified by:
      setFloat in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setLong

      public void setLong(String parameterName, long x) throws SQLException
      Sets the value of a parameter.
      Specified by:
      setLong in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setInt

      public void setInt(String parameterName, int x) throws SQLException
      Sets the value of a parameter.
      Specified by:
      setInt in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setShort

      public void setShort(String parameterName, short x) throws SQLException
      Sets the value of a parameter.
      Specified by:
      setShort in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setByte

      public void setByte(String parameterName, byte x) throws SQLException
      Sets the value of a parameter.
      Specified by:
      setByte in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setBoolean

      public void setBoolean(String parameterName, boolean x) throws SQLException
      Sets the value of a parameter.
      Specified by:
      setBoolean in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setURL

      public void setURL(String parameterName, URL val) throws SQLException
      [Not supported]
      Specified by:
      setURL in interface CallableStatement
      Throws:
      SQLException
    • setRowId

      public void setRowId(String parameterName, RowId x) throws SQLException
      [Not supported] Sets the value of a parameter as a row id.
      Specified by:
      setRowId in interface CallableStatement
      Throws:
      SQLException
    • setNString

      public void setNString(String parameterName, String x) throws SQLException
      Sets the value of a parameter.
      Specified by:
      setNString in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setNCharacterStream

      public void setNCharacterStream(String parameterName, Reader x, long length) throws SQLException
      Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.
      Specified by:
      setNCharacterStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      length - the maximum number of characters
      Throws:
      SQLException - if this object is closed
    • setNClob

      public void setNClob(String parameterName, NClob x) throws SQLException
      Sets the value of a parameter as a Clob.
      Specified by:
      setNClob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setClob

      public void setClob(String parameterName, Reader x, long length) throws SQLException
      Sets the value of a parameter as a Clob. This method does not close the reader. The reader may be closed after executing the statement.
      Specified by:
      setClob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      length - the maximum number of characters
      Throws:
      SQLException - if this object is closed
    • setBlob

      public void setBlob(String parameterName, InputStream x, long length) throws SQLException
      Sets the value of a parameter as a Blob. This method does not close the stream. The stream may be closed after executing the statement.
      Specified by:
      setBlob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      length - the maximum number of bytes
      Throws:
      SQLException - if this object is closed
    • setNClob

      public void setNClob(String parameterName, Reader x, long length) throws SQLException
      Sets the value of a parameter as a Clob. This method does not close the reader. The reader may be closed after executing the statement.
      Specified by:
      setNClob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      length - the maximum number of characters
      Throws:
      SQLException - if this object is closed
    • setBlob

      public void setBlob(String parameterName, Blob x) throws SQLException
      Sets the value of a parameter as a Blob.
      Specified by:
      setBlob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setClob

      public void setClob(String parameterName, Clob x) throws SQLException
      Sets the value of a parameter as a Clob.
      Specified by:
      setClob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setAsciiStream

      public void setAsciiStream(String parameterName, InputStream x) throws SQLException
      Sets the value of a parameter as an ASCII stream. This method does not close the stream. The stream may be closed after executing the statement.
      Specified by:
      setAsciiStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setAsciiStream

      public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException
      Sets the value of a parameter as an ASCII stream. This method does not close the stream. The stream may be closed after executing the statement.
      Specified by:
      setAsciiStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      length - the maximum number of bytes
      Throws:
      SQLException - if this object is closed
    • setBinaryStream

      public void setBinaryStream(String parameterName, InputStream x) throws SQLException
      Sets the value of a parameter as an input stream. This method does not close the stream. The stream may be closed after executing the statement.
      Specified by:
      setBinaryStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setBinaryStream

      public void setBinaryStream(String parameterName, InputStream x, long length) throws SQLException
      Sets the value of a parameter as an input stream. This method does not close the stream. The stream may be closed after executing the statement.
      Specified by:
      setBinaryStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      length - the maximum number of bytes
      Throws:
      SQLException - if this object is closed
    • setBlob

      public void setBlob(String parameterName, InputStream x) throws SQLException
      Sets the value of a parameter as a Blob. This method does not close the stream. The stream may be closed after executing the statement.
      Specified by:
      setBlob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setCharacterStream

      public void setCharacterStream(String parameterName, Reader x) throws SQLException
      Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.
      Specified by:
      setCharacterStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setCharacterStream

      public void setCharacterStream(String parameterName, Reader x, long length) throws SQLException
      Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.
      Specified by:
      setCharacterStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      length - the maximum number of characters
      Throws:
      SQLException - if this object is closed
    • setClob

      public void setClob(String parameterName, Reader x) throws SQLException
      Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.
      Specified by:
      setClob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setNCharacterStream

      public void setNCharacterStream(String parameterName, Reader x) throws SQLException
      Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.
      Specified by:
      setNCharacterStream in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setNClob

      public void setNClob(String parameterName, Reader x) throws SQLException
      Sets the value of a parameter as a Clob. This method does not close the reader. The reader may be closed after executing the statement.
      Specified by:
      setNClob in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • setSQLXML

      public void setSQLXML(String parameterName, SQLXML x) throws SQLException
      Sets the value of a parameter as a SQLXML object.
      Specified by:
      setSQLXML in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      x - the value
      Throws:
      SQLException - if this object is closed
    • getObject

      public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException
      Returns the value of the specified column as a Java object of the specified type.
      Specified by:
      getObject in interface CallableStatement
      Parameters:
      parameterIndex - the parameter index (1, 2, ...)
      type - the class of the returned value
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed
    • getObject

      public <T> T getObject(String parameterName, Class<T> type) throws SQLException
      Returns the value of the specified column as a Java object of the specified type.
      Specified by:
      getObject in interface CallableStatement
      Parameters:
      parameterName - the parameter name
      type - the class of the returned value
      Returns:
      the value
      Throws:
      SQLException - if the column is not found or if this object is closed