Class JdbcCallableStatement
- All Implemented Interfaces:
AutoCloseable
,CallableStatement
,PreparedStatement
,Statement
,Wrapper
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(); }
-
Field Summary
Fields inherited from class org.h2.jdbc.JdbcPreparedStatement
command
Fields inherited from class org.h2.jdbc.JdbcStatement
conn, fetchSize, generatedKeys, maxRows, resultSet, resultSetConcurrency, resultSetType, session, updateCount
Fields inherited from class org.h2.message.TraceObject
ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, SQLXML, STATEMENT, trace, XA_DATA_SOURCE, XID
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
-
Method Summary
Modifier and TypeMethodDescriptionlong
Executes a statement (insert, update, delete, create, drop) and returns the update count.int
Executes a statement (insert, update, delete, create, drop) and returns the update count.getArray
(int parameterIndex) Returns the value of the specified column as an Array.Returns the value of the specified column as an Array.getBigDecimal
(int parameterIndex) Returns the value of the specified column as a BigDecimal.getBigDecimal
(int parameterIndex, int scale) Deprecated.getBigDecimal
(String parameterName) Returns the value of the specified column as a BigDecimal.getBlob
(int parameterIndex) Returns the value of the specified column as a Blob.Returns the value of the specified column as a Blob.boolean
getBoolean
(int parameterIndex) Returns the value of the specified column as a boolean.boolean
getBoolean
(String parameterName) Returns the value of the specified column as a boolean.byte
getByte
(int parameterIndex) Returns the value of the specified column as a byte.byte
Returns the value of the specified column as a byte.byte[]
getBytes
(int parameterIndex) Returns the value of the specified column as a byte array.byte[]
Returns the value of the specified column as a byte array.getCharacterStream
(int parameterIndex) Returns the value of the specified column as a reader.getCharacterStream
(String parameterName) Returns the value of the specified column as a reader.getClob
(int parameterIndex) Returns the value of the specified column as a Clob.Returns the value of the specified column as a Clob.getDate
(int parameterIndex) Returns the value of the specified column as a java.sql.Date.Returns the value of the specified column as a java.sql.Date using a specified time zone.Returns the value of the specified column as a java.sql.Date.Returns the value of the specified column as a java.sql.Date using a specified time zone.double
getDouble
(int parameterIndex) Returns the value of the specified column as a double.double
Returns the value of the specified column as a double.float
getFloat
(int parameterIndex) Returns the value of the specified column as a float.float
Returns the value of the specified column as a float.int
getInt
(int parameterIndex) Returns the value of the specified column as an int.int
Returns the value of the specified column as an int.long
getLong
(int parameterIndex) Returns the value of the specified column as a long.long
Returns the value of the specified column as a long.getNCharacterStream
(int parameterIndex) Returns the value of the specified column as a reader.getNCharacterStream
(String parameterName) Returns the value of the specified column as a reader.getNClob
(int parameterIndex) Returns the value of the specified column as a Clob.Returns the value of the specified column as a Clob.getNString
(int parameterIndex) Returns the value of the specified column as a String.getNString
(String parameterName) Returns the value of the specified column as a String.getObject
(int parameterIndex) Returns a column value as a Java object.<T> T
Returns the value of the specified column as a Java object of the specified type.[Not supported] Gets a column as a object using the specified type mapping.Returns a column value as a Java object.<T> T
Returns the value of the specified column as a Java object of the specified type.[Not supported] Gets a column as a object using the specified type mapping.getRef
(int parameterIndex) [Not supported] Gets a column as a reference.[Not supported] Gets a column as a reference.getRowId
(int parameterIndex) [Not supported] Returns the value of the specified column as a row id.[Not supported] Returns the value of the specified column as a row id.short
getShort
(int parameterIndex) Returns the value of the specified column as a short.short
Returns the value of the specified column as a short.getSQLXML
(int parameterIndex) Returns the value of the specified column as a SQLXML object.Returns the value of the specified column as a SQLXML object.getString
(int parameterIndex) Returns the value of the specified column as a String.Returns the value of the specified column as a String.getTime
(int parameterIndex) Returns the value of the specified column as a java.sql.Time.Returns the value of the specified column as a java.sql.Time using a specified time zone.Returns the value of the specified column as a java.sql.Time.Returns the value of the specified column as a java.sql.Time using a specified time zone.getTimestamp
(int parameterIndex) Returns the value of the specified column as a java.sql.Timestamp.getTimestamp
(int parameterIndex, Calendar cal) Returns the value of the specified column as a java.sql.Timestamp using a specified time zone.getTimestamp
(String parameterName) Returns the value of the specified column as a java.sql.Timestamp.getTimestamp
(String parameterName, Calendar cal) Returns the value of the specified column as a java.sql.Timestamp using a specified time zone.getURL
(int parameterIndex) [Not supported][Not supported]void
registerOutParameter
(int parameterIndex, int sqlType) Registers the given OUT parameter.void
registerOutParameter
(int parameterIndex, int sqlType, int scale) Registers the given OUT parameter.void
registerOutParameter
(int parameterIndex, int sqlType, String typeName) Registers the given OUT parameter.void
registerOutParameter
(String parameterName, int sqlType) Registers the given OUT parameter.void
registerOutParameter
(String parameterName, int sqlType, int scale) Registers the given OUT parameter.void
registerOutParameter
(String parameterName, int sqlType, String typeName) Registers the given OUT parameter.void
setAsciiStream
(String parameterName, InputStream x) Sets the value of a parameter as an ASCII stream.void
setAsciiStream
(String parameterName, InputStream x, int length) Sets the value of a parameter as an ASCII stream.void
setAsciiStream
(String parameterName, InputStream x, long length) Sets the value of a parameter as an ASCII stream.void
setBigDecimal
(String parameterName, BigDecimal x) Sets the value of a parameter.void
setBinaryStream
(String parameterName, InputStream x) Sets the value of a parameter as an input stream.void
setBinaryStream
(String parameterName, InputStream x, int length) Sets the value of a parameter as an input stream.void
setBinaryStream
(String parameterName, InputStream x, long length) Sets the value of a parameter as an input stream.void
setBlob
(String parameterName, InputStream x) Sets the value of a parameter as a Blob.void
setBlob
(String parameterName, InputStream x, long length) Sets the value of a parameter as a Blob.void
Sets the value of a parameter as a Blob.void
setBoolean
(String parameterName, boolean x) Sets the value of a parameter.void
Sets the value of a parameter.void
Sets the value of a parameter as a byte array.void
setCharacterStream
(String parameterName, Reader x) Sets the value of a parameter as a character stream.void
setCharacterStream
(String parameterName, Reader x, int length) Sets the value of a parameter as a character stream.void
setCharacterStream
(String parameterName, Reader x, long length) Sets the value of a parameter as a character stream.void
Sets the value of a parameter as a character stream.void
Sets the value of a parameter as a Clob.void
Sets the value of a parameter as a Clob.void
Sets the value of a parameter.void
Sets the date using a specified time zone.void
Sets the value of a parameter.void
Sets the value of a parameter.void
Sets the value of a parameter.void
Sets the value of a parameter.void
setNCharacterStream
(String parameterName, Reader x) Sets the value of a parameter as a character stream.void
setNCharacterStream
(String parameterName, Reader x, long length) Sets the value of a parameter as a character stream.void
Sets the value of a parameter as a Clob.void
Sets the value of a parameter as a Clob.void
Sets the value of a parameter as a Clob.void
setNString
(String parameterName, String x) Sets the value of a parameter.void
Sets a parameter to null.void
Sets a parameter to null.void
Sets the value of a parameter.void
Sets the value of a parameter.void
Sets the value of a parameter.void
Sets the value of a parameter.void
Sets the value of a parameter.void
[Not supported] Sets the value of a parameter as a row id.void
Sets the value of a parameter.void
Sets the value of a parameter as a SQLXML object.void
Sets the value of a parameter.void
Sets the time using a specified time zone.void
Sets the time using a specified time zone.void
setTimestamp
(String parameterName, Timestamp x) Sets the value of a parameter.void
setTimestamp
(String parameterName, Timestamp x, Calendar cal) Sets the timestamp using a specified time zone.void
[Not supported]boolean
wasNull()
Returns whether the last column accessed was null.Methods inherited from class org.h2.jdbc.JdbcPreparedStatement
addBatch, addBatch, clearBatch, clearParameters, close, execute, executeBatch, executeLargeBatch, executeQuery, executeQuery, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL, toString
Methods inherited from class org.h2.jdbc.JdbcStatement
cancel, clearWarnings, closeOldResultSet, closeOnCompletion, enquoteIdentifier, execute, execute, execute, execute, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isCancelled, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap
Methods inherited from class org.h2.message.TraceObject
debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupported
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.sql.CallableStatement
registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter
Methods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, execute, executeQuery, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Method Details
-
executeUpdate
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 interfacePreparedStatement
- Overrides:
executeUpdate
in classJdbcPreparedStatement
- 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
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 interfacePreparedStatement
- Overrides:
executeLargeUpdate
in classJdbcPreparedStatement
- 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
Registers the given OUT parameter.- Specified by:
registerOutParameter
in interfaceCallableStatement
- 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 interfaceCallableStatement
- Parameters:
parameterIndex
- the parameter index (1, 2, ...)sqlType
- the data type (Types.x) - ignoredtypeName
- the SQL type name - ignored- Throws:
SQLException
-
registerOutParameter
Registers the given OUT parameter.- Specified by:
registerOutParameter
in interfaceCallableStatement
- 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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namesqlType
- the data type (Types.x) - ignoredtypeName
- the SQL type name - ignored- Throws:
SQLException
-
registerOutParameter
Registers the given OUT parameter.- Specified by:
registerOutParameter
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namesqlType
- the data type (Types.x) - ignoredscale
- is ignored- Throws:
SQLException
-
registerOutParameter
Registers the given OUT parameter.- Specified by:
registerOutParameter
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namesqlType
- the data type (Types.x) - ignored- Throws:
SQLException
-
wasNull
Returns whether the last column accessed was null.- Specified by:
wasNull
in interfaceCallableStatement
- Returns:
- true if the last column accessed was null
- Throws:
SQLException
-
getURL
[Not supported]- Specified by:
getURL
in interfaceCallableStatement
- Throws:
SQLException
-
getString
Returns the value of the specified column as a String.- Specified by:
getString
in interfaceCallableStatement
- Parameters:
parameterIndex
- (1,2,...)- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getBoolean
Returns the value of the specified column as a boolean.- Specified by:
getBoolean
in interfaceCallableStatement
- Parameters:
parameterIndex
- (1,2,...)- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getByte
Returns the value of the specified column as a byte.- Specified by:
getByte
in interfaceCallableStatement
- Parameters:
parameterIndex
- (1,2,...)- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getShort
Returns the value of the specified column as a short.- Specified by:
getShort
in interfaceCallableStatement
- Parameters:
parameterIndex
- (1,2,...)- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getInt
Returns the value of the specified column as an int.- Specified by:
getInt
in interfaceCallableStatement
- 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
Returns the value of the specified column as a long.- Specified by:
getLong
in interfaceCallableStatement
- 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
Returns the value of the specified column as a float.- Specified by:
getFloat
in interfaceCallableStatement
- 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
Returns the value of the specified column as a double.- Specified by:
getDouble
in interfaceCallableStatement
- 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.Returns the value of the specified column as a BigDecimal.- Specified by:
getBigDecimal
in interfaceCallableStatement
- 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
Returns the value of the specified column as a byte array.- Specified by:
getBytes
in interfaceCallableStatement
- 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
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 interfaceCallableStatement
- 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
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 interfaceCallableStatement
- 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
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 interfaceCallableStatement
- 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
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 interfaceCallableStatement
- 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
Returns the value of the specified column as a BigDecimal.- Specified by:
getBigDecimal
in interfaceCallableStatement
- 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
[Not supported] Gets a column as a object using the specified type mapping.- Specified by:
getObject
in interfaceCallableStatement
- Throws:
SQLException
-
getRef
[Not supported] Gets a column as a reference.- Specified by:
getRef
in interfaceCallableStatement
- Throws:
SQLException
-
getBlob
Returns the value of the specified column as a Blob.- Specified by:
getBlob
in interfaceCallableStatement
- 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
Returns the value of the specified column as a Clob.- Specified by:
getClob
in interfaceCallableStatement
- 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
Returns the value of the specified column as an Array.- Specified by:
getArray
in interfaceCallableStatement
- 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
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 interfaceCallableStatement
- 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
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 interfaceCallableStatement
- 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
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 interfaceCallableStatement
- 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
[Not supported]- Specified by:
getURL
in interfaceCallableStatement
- Throws:
SQLException
-
getTimestamp
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namecal
- the calendar- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed- See Also:
-
getTime
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namecal
- the calendar- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed- See Also:
-
getDate
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namecal
- the calendar- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed- See Also:
-
getArray
Returns the value of the specified column as an Array.- Specified by:
getArray
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getClob
Returns the value of the specified column as a Clob.- Specified by:
getClob
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getBlob
Returns the value of the specified column as a Blob.- Specified by:
getBlob
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getRef
[Not supported] Gets a column as a reference.- Specified by:
getRef
in interfaceCallableStatement
- Throws:
SQLException
-
getObject
[Not supported] Gets a column as a object using the specified type mapping.- Specified by:
getObject
in interfaceCallableStatement
- Throws:
SQLException
-
getBigDecimal
Returns the value of the specified column as a BigDecimal.- Specified by:
getBigDecimal
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getObject
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 interfaceCallableStatement
- 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
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 interfaceCallableStatement
- 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
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 interfaceCallableStatement
- 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
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 interfaceCallableStatement
- 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
Returns the value of the specified column as a byte array.- Specified by:
getBytes
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getDouble
Returns the value of the specified column as a double.- Specified by:
getDouble
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getFloat
Returns the value of the specified column as a float.- Specified by:
getFloat
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getLong
Returns the value of the specified column as a long.- Specified by:
getLong
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getInt
Returns the value of the specified column as an int.- Specified by:
getInt
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getShort
Returns the value of the specified column as a short.- Specified by:
getShort
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getByte
Returns the value of the specified column as a byte.- Specified by:
getByte
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getBoolean
Returns the value of the specified column as a boolean.- Specified by:
getBoolean
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getString
Returns the value of the specified column as a String.- Specified by:
getString
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getRowId
[Not supported] Returns the value of the specified column as a row id.- Specified by:
getRowId
in interfaceCallableStatement
- Parameters:
parameterIndex
- the parameter index (1, 2, ...)- Throws:
SQLException
-
getRowId
[Not supported] Returns the value of the specified column as a row id.- Specified by:
getRowId
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Throws:
SQLException
-
getNClob
Returns the value of the specified column as a Clob.- Specified by:
getNClob
in interfaceCallableStatement
- 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
Returns the value of the specified column as a Clob.- Specified by:
getNClob
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getSQLXML
Returns the value of the specified column as a SQLXML object.- Specified by:
getSQLXML
in interfaceCallableStatement
- 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
Returns the value of the specified column as a SQLXML object.- Specified by:
getSQLXML
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getNString
Returns the value of the specified column as a String.- Specified by:
getNString
in interfaceCallableStatement
- 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
Returns the value of the specified column as a String.- Specified by:
getNString
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getNCharacterStream
Returns the value of the specified column as a reader.- Specified by:
getNCharacterStream
in interfaceCallableStatement
- 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
Returns the value of the specified column as a reader.- Specified by:
getNCharacterStream
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getCharacterStream
Returns the value of the specified column as a reader.- Specified by:
getCharacterStream
in interfaceCallableStatement
- 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
Returns the value of the specified column as a reader.- Specified by:
getCharacterStream
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter name- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
setNull
Sets a parameter to null.- Specified by:
setNull
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namesqlType
- the data type (Types.x)typeName
- this parameter is ignored- Throws:
SQLException
- if this object is closed
-
setNull
Sets a parameter to null.- Specified by:
setNull
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namesqlType
- the data type (Types.x)- Throws:
SQLException
- if this object is closed
-
setTimestamp
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)
withLocalDateTime
parameter instead.- Specified by:
setTimestamp
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuecal
- the calendar- Throws:
SQLException
- if this object is closed- See Also:
-
setTime
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)
withLocalTime
parameter instead.- Specified by:
setTime
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuecal
- the calendar- Throws:
SQLException
- if this object is closed- See Also:
-
setDate
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)
withLocalDate
parameter instead.- Specified by:
setDate
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuecal
- the calendar- Throws:
SQLException
- if this object is closed- See Also:
-
setCharacterStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuelength
- the maximum number of characters- Throws:
SQLException
- if this object is closed
-
setObject
Sets the value of a parameter. Objects of unknown classes are serialized (on the client side).- Specified by:
setObject
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setObject
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value, null is allowedtargetSqlType
- 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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value, null is allowedtargetSqlType
- the type as defined in java.sql.Typesscale
- is ignored- Throws:
SQLException
- if this object is closed
-
setObject
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value, null is allowedtargetSqlType
- 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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value, null is allowedtargetSqlType
- the typescaleOrLength
- is ignored- Throws:
SQLException
- if this object is closed
-
setBinaryStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuelength
- the maximum number of bytes- Throws:
SQLException
- if this object is closed
-
setAsciiStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuelength
- the maximum number of bytes- Throws:
SQLException
- if this object is closed
-
setTimestamp
Sets the value of a parameter.Usage of this method is discouraged. Use
setObject(parameterName, value)
withLocalDateTime
parameter instead.- Specified by:
setTimestamp
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed- See Also:
-
setTime
Sets the time using a specified time zone.Usage of this method is discouraged. Use
setObject(parameterName, value)
withLocalTime
parameter instead.- Specified by:
setTime
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed- See Also:
-
setDate
Sets the value of a parameter.Usage of this method is discouraged. Use
setObject(parameterName, value)
withLocalDate
parameter instead.- Specified by:
setDate
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed- See Also:
-
setBytes
Sets the value of a parameter as a byte array.- Specified by:
setBytes
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setString
Sets the value of a parameter.- Specified by:
setString
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setBigDecimal
Sets the value of a parameter.- Specified by:
setBigDecimal
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setDouble
Sets the value of a parameter.- Specified by:
setDouble
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setFloat
Sets the value of a parameter.- Specified by:
setFloat
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setLong
Sets the value of a parameter.- Specified by:
setLong
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setInt
Sets the value of a parameter.- Specified by:
setInt
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setShort
Sets the value of a parameter.- Specified by:
setShort
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setByte
Sets the value of a parameter.- Specified by:
setByte
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setBoolean
Sets the value of a parameter.- Specified by:
setBoolean
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setURL
[Not supported]- Specified by:
setURL
in interfaceCallableStatement
- Throws:
SQLException
-
setRowId
[Not supported] Sets the value of a parameter as a row id.- Specified by:
setRowId
in interfaceCallableStatement
- Throws:
SQLException
-
setNString
Sets the value of a parameter.- Specified by:
setNString
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setNCharacterStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuelength
- the maximum number of characters- Throws:
SQLException
- if this object is closed
-
setNClob
Sets the value of a parameter as a Clob.- Specified by:
setNClob
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setClob
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuelength
- the maximum number of characters- Throws:
SQLException
- if this object is closed
-
setBlob
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuelength
- the maximum number of bytes- Throws:
SQLException
- if this object is closed
-
setNClob
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuelength
- the maximum number of characters- Throws:
SQLException
- if this object is closed
-
setBlob
Sets the value of a parameter as a Blob.- Specified by:
setBlob
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setClob
Sets the value of a parameter as a Clob.- Specified by:
setClob
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setAsciiStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setAsciiStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuelength
- the maximum number of bytes- Throws:
SQLException
- if this object is closed
-
setBinaryStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setBinaryStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuelength
- the maximum number of bytes- Throws:
SQLException
- if this object is closed
-
setBlob
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setCharacterStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setCharacterStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the valuelength
- the maximum number of characters- Throws:
SQLException
- if this object is closed
-
setClob
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setNCharacterStream
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setNClob
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 interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
setSQLXML
Sets the value of a parameter as a SQLXML object.- Specified by:
setSQLXML
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter namex
- the value- Throws:
SQLException
- if this object is closed
-
getObject
Returns the value of the specified column as a Java object of the specified type.- Specified by:
getObject
in interfaceCallableStatement
- 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
Returns the value of the specified column as a Java object of the specified type.- Specified by:
getObject
in interfaceCallableStatement
- Parameters:
parameterName
- the parameter nametype
- the class of the returned value- Returns:
- the value
- Throws:
SQLException
- if the column is not found or if this object is closed
-
getBigDecimal(int)