DB2 10.5 for Linux, UNIX, and Windows

DB2CallableStatement interface

The com.ibm.db2.jcc.DB2CallableStatement interface extends the java.sql.CallableStatement and the com.ibm.db2.jcc.DB2PreparedStatement interfaces.

DB2CallableStatement methods

The following methods are defined only for the IBM® Data Server Driver for JDBC and SQLJ.

getDBTimestamp
Formats:
public DBTimestamp getDBTimestamp(int parameterIndex) 
  throws SQLException
public DBTimestamp getDBTimestamp(String parameterName) 
  throws SQLException

Returns the value of a TIMESTAMP OUT or INOUT parameter as a DBTimestamp object. If the value of the parameter is NULL, the returned value is null.

Parameters:
parameterIndex
The number of the parameter whose value is being retrieved.
parameterName
The name of the parameter whose value is being retrieved.

This method is not supported for connections to IBM Informix®.

getJccArrayAtName
Format:
public java.sql.Array getJccArrayAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves an ARRAY value that is designated by a named parameter marker as a java.sql.Array value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccBigDecimalAtName
Format:
public java.math.BigDecimal getJccBigDecimalAtName(String parameterMarkerName) 
  throws java.sql.SQLException
public java.math.BigDecimal getJccBigDecimalAtName(String parameterMarkerName,
  int scale)
  throws java.sql.SQLException

Retrieves a DECIMAL value that is designated by a named parameter marker as a java.math.BigDecimal value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
scale
The scale of the value that is retrieved.
getJccBlobAtName
Formats:
public java.sql.Blob getJccBlobAtName(String parameterMarkerName)
  throws java.sql.SQLException

Retrieves a BLOB value that is designated by a named parameter marker as a java.sql.Blob value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccBooleanAtName
Format:
public boolean getJccBooleanAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a BIT or BOOLEAN value that is designated by a named parameter marker as a boolean value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccByteAtName
Format:
public byte getJccByteAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a TINYINT value that is designated by a named parameter marker as a byte value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccBytesAtName
Format:
public byte[] getJccBytesAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a BINARY or VARBINARY value that is designated by a named parameter marker as an array of byte values.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccClobAtName
Format:
public java.sql.Blob getJccClobAtName(String parameterMarkerName)
  throws java.sql.SQLException

Retrieves a CLOB value that is designated by a named parameter marker as a java.sql.Clob value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccDateAtName
Formats:
public java.sql.Date getJccDateAtName(String parameterMarkerName) 
  throws java.sql.SQLException
public java.sql.Date getJccDateAtName(String parameterMarkerName,
  java.util.Calendar cal) 
  throws java.sql.SQLException

Retrieves a DATE value that is designated by a named parameter marker as a java.sql.Date value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
cal
The java.util.Calendar object that the IBM Data Server Driver for JDBC and SQLJ uses to construct the date.
getJccDoubleAtName
Format:
public double getJccDoubleAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a DOUBLE value that is designated by a named parameter marker as a double value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccFloatAtName
Format:
public double getJccFloatAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a FLOAT value that is designated by a named parameter marker as a double value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccIntAtName
Format:
public int getJccIntAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a INTEGER value that is designated by a named parameter marker as a int value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccLongAtName
Format:
public long getJccLongAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a BIGINT value that is designated by a named parameter marker as a long value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccObjectAtName
Formats:
public java.sql.Object getJccObjectAtName(String parameterMarkerName)
  throws java.sql.SQLException
public java.sql.Object getJccObjectAtName(String parameterMarkerName,
  Map map)
  throws java.sql.SQLException

Retrieves a value that is designated by a named parameter marker as a java.sql.Object value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
map
The mapping from SQL type names to Java™ classes.
getJccRowIdAtName
Format:
public java.sql.RowId getJccRowIdAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a ROWID value that is designated by a named parameter marker as a java.sql.RowId value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

This method requires the IBM Data Server Driver for JDBC and SQLJ Version 4.8 or later.

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccShortAtName
Format:
public short getJccShortAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a SMALLINT value that is designated by a named parameter marker as a short value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccSQLXMLAtName
Format:
public java.sql.SQLXML getJccSQLXMLAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a SQLXML value that is designated by a named parameter marker as a java.sql.SQLXML value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

This method requires the IBM Data Server Driver for JDBC and SQLJ Version 4.8 or later.

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccStringAtName
Format:
public java.lang.String getJccStringAtName(String parameterMarkerName) 
  throws java.sql.SQLException

Retrieves a CHAR, VARcHAR, or LONGVARCHAR value that is designated by a named parameter marker as a java.lang.String value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
getJccTimeAtName
Formats:
public java.sql.Time getJccTimeAtName(String parameterMarkerName) 
  throws java.sql.SQLException
public java.sql.Time getJccTimeAtName(String parameterMarkerName,
  java.util.Calendar cal) 
  throws java.sql.SQLException

Retrieves a TIME value that is designated by a named parameter marker as a java.sql.Time value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
cal
The java.util.Calendar object that the IBM Data Server Driver for JDBC and SQLJ uses to construct the time.
getJccTimestampAtName
Formats:
public java.sql.Timestamp getJccTimestampAtName(String parameterMarkerName) 
  throws java.sql.SQLException
public java.sql.Timestamp getJccTimestampAtName(String parameterMarkerName,
  java.util.Calendar cal) 
  throws java.sql.SQLException

Retrieves a TIMESTAMP value that is designated by a named parameter marker as a java.sql.Timestamp value.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for which a value is retrieved.
cal
The java.util.Calendar object that the IBM Data Server Driver for JDBC and SQLJ uses to construct the timestamp.
registerJccOutParameterAtName
Formats:
public void registerJccOutParameterAtName(String parameterMarkerName, 
  int sqlType) 
  throws java.sql.SQLException
public void registerJccOutParameterAtName(String parameterMarkerName, 
  int sqlType,
  int scale) 
  throws java.sql.SQLException
public void registerJccOutParameterAtName(String parameterMarkerName, 
  int sqlType,
  String typeName) 
  throws java.sql.SQLException

Registers an OUT parameter that is identified by parameterMarkerName as the JDBC type sqlType.

This method can be called only if the enableNamedParameterMarkers property is set to DB2BaseDataSource.YES (1).

Parameters:
parameterMarkerName
The name of the parameter marker for the parameter that is to be registered.
sqlType
The JDBC type code, as defined in java.sql.Types, of the parameter that is to be registered.
scale
The scale of the parameter that is to be registered. This parameter applies only to this case:
  • If sqlType is java.sql.Types.DECIMAL or java.sql.Types.NUMERIC, scale is the number of digits to the right of the decimal point.
typeName
If jdbcType is java.sql.Types.DISTINCT or java.sql.Types.REF, the fully-qualified name of the SQL user-defined type of the parameter that is to be registered.
setDBTimestamp
Format:
public void setDBTimestamp(String parameterName, 
  DBTimestamp timestamp)
  throws java.sql.SQLException

Assigns a DBTimestamp value to an IN or INOUT parameter.

Parameters:
parameterName
The name of the parameter to which a DBTimestamp variable value is assigned.
timestamp
The DBTimestamp value that is assigned to the parameter.

This method is not supported for connections to IBM Informix.

setJccXXXAtName methods
These methods are inherited from DB2PreparedStatement.