Skip to content

Most visited

Recently visited

navigation
Added in API level 1

CallableStatement

public interface CallableStatement
implements PreparedStatement

java.sql.CallableStatement


An interface used to call Stored Procedures.

The JDBC API provides an SQL escape syntax allowing Stored Procedures to be called in a standard way for all databases. The JDBC escape syntax has two forms. One form includes a result parameter. The second form does not include a result parameter. Where the result parameter is used, it must be declared as an OUT parameter. Other parameters can be declared as IN, OUT, or INOUT. Parameters are referenced either by name or by a numerical index starting at 1.

The correct syntax is:

{ ?= call <procedurename> [( [parameter1,parameter2,...] )] }
{ call <procedurename> [( [parameter1,parameter2,...] )] }
IN parameters are set before calling the procedure, using the setter methods which are inherited from PreparedStatement. For OUT parameters, their type must be registered before executing the stored procedure. The values are retrieved using the getter methods defined in the CallableStatement interface.

CallableStatements can return one or more ResultSets. In the event that multiple ResultSets are returned, they are accessed using the methods inherited from the Statement interface.

Summary

Inherited constants

From interface java.sql.Statement

Public methods

abstract Array getArray(int parameterIndex)

Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.

abstract Array getArray(String parameterName)

Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.

abstract BigDecimal getBigDecimal(String parameterName)

Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input name.

abstract BigDecimal getBigDecimal(int parameterIndex, int scale)

This method was deprecated in API level 1. Use getBigDecimal(int) or getBigDecimal(String) instead.

abstract BigDecimal getBigDecimal(int parameterIndex)

Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input index.

abstract Blob getBlob(String parameterName)

Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob.

abstract Blob getBlob(int parameterIndex)

Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob.

abstract boolean getBoolean(int parameterIndex)

Gets the value of a specified JDBC BIT parameter as a boolean.

abstract boolean getBoolean(String parameterName)

Gets the value of a specified JDBC BIT parameter as a boolean.

abstract byte getByte(String parameterName)

Gets the value of a specified JDBC TINYINT parameter as a Java byte.

abstract byte getByte(int parameterIndex)

Gets the value of a specified JDBC TINYINT parameter as a byte.

abstract byte[] getBytes(int parameterIndex)

Returns a byte array representation of the indexed JDBC BINARY or VARBINARY parameter.

abstract byte[] getBytes(String parameterName)

Returns a byte array representation of the named JDBC BINARY or VARBINARY parameter.

abstract Reader getCharacterStream(String parameterName)

Returns the value of the specified parameter as a java.io.Reader.

abstract Reader getCharacterStream(int parameterIndex)

Returns the value of the specified parameter as a java.io.Reader.

abstract Clob getClob(int parameterIndex)

Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob.

abstract Clob getClob(String parameterName)

Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob.

abstract Date getDate(int parameterIndex, Calendar cal)

Gets the value of the specified JDBC DATE parameter as a java.sql.Date, using the specified Calendar to construct the date.

abstract Date getDate(int parameterIndex)

Gets the value of the specified JDBC DATE parameter as a java.sql.Date.

abstract Date getDate(String parameterName, Calendar cal)

Gets the value of the specified JDBC DATE parameter as a java.sql.Date, using the specified Calendar to construct the date.

abstract Date getDate(String parameterName)

Gets the value of the specified JDBC DATE parameter as a java.sql.Date.

abstract double getDouble(String parameterName)

Gets the value of the specified JDBC DOUBLE parameter as a double.

abstract double getDouble(int parameterIndex)

Gets the value of the specified JDBC DOUBLE parameter as a double.

abstract float getFloat(int parameterIndex)

Gets the value of the specified JDBC FLOAT parameter as a float.

abstract float getFloat(String parameterName)

Gets the value of the specified JDBC FLOAT parameter as a Java float.

abstract int getInt(String parameterName)

Gets the value of the specified JDBC INTEGER parameter as an int.

abstract int getInt(int parameterIndex)

Gets the value of the specified JDBC INTEGER parameter as an int.

abstract long getLong(String parameterName)

Gets the value of the specified JDBC BIGINT parameter as a long.

abstract long getLong(int parameterIndex)

Gets the value of the specified JDBC BIGINT parameter as a long.

abstract Reader getNCharacterStream(int parameterIndex)

Returns the value of the specified SQL NCHAR, NVARCHAR, or LONGNVARCHAR parameter as a Reader.

abstract Reader getNCharacterStream(String parameterName)

Returns the value of the specified SQL NCHAR, NVARCHAR, or LONGNVARCHAR parameter as a java.io.Reader.

abstract NClob getNClob(String parameterName)

Returns the value of the specified SQL NCLOB parameter as a java.sql.NClob.

abstract NClob getNClob(int parameterIndex)

Returns the value of the specified SQL NCLOB parameter as a java.sql.NClob.

abstract String getNString(String parameterName)

Returns the value of the specified SQL NCHAR, NVARCHAR, or LONGNVARCHAR parameter as a java.lang.String.

abstract String getNString(int parameterIndex)

Returns the value of the specified SQL NCHAR, NVARCHAR, or LONGNVARCHAR parameter as a java.lang.String.

abstract Object getObject(String parameterName, Map<StringClass<?>> map)

Gets the value of a specified parameter as an Object.

abstract Object getObject(int parameterIndex, Map<StringClass<?>> map)

Gets the value of the specified parameter as an Object.

abstract Object getObject(String parameterName)

Gets the value of the specified parameter as an Object.

abstract Object getObject(int parameterIndex)

Gets the value of the specified parameter as a Java Object.

abstract Ref getRef(String parameterName)

Gets the value of a specified SQL REF() parameter as a java.sql.Ref.

abstract Ref getRef(int parameterIndex)

Gets the value of a specified SQL REF() parameter as a java.sql.Ref.

abstract RowId getRowId(String parameterName)

Returns the value of the specified SQL ROWID parameter as a java.sql.RowId.

abstract RowId getRowId(int parameterIndex)

Gets the value of a specified ROWID parameter as a java.sql.RowId.

abstract SQLXML getSQLXML(String parameterName)

Returns the value of the specified SQL XML parameter as a java.sql.SQLXML.

abstract SQLXML getSQLXML(int parameterIndex)

Returns the value of the specified SQL XML parameter as a java.sql.SQLXML.

abstract short getShort(String parameterName)

Gets the value of a specified JDBC SMALLINT parameter as a short.

abstract short getShort(int parameterIndex)

Gets the value of a specified JDBC SMALLINT parameter as a short.

abstract String getString(int parameterIndex)

Returns the indexed parameter's value as a String.

abstract String getString(String parameterName)

Returns the named parameter's value as a string.

abstract Time getTime(String parameterName, Calendar cal)

Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time.

abstract Time getTime(String parameterName)

Gets the value of a specified JDBC TIME parameter as a java.sql.Time.

abstract Time getTime(int parameterIndex, Calendar cal)

Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time.

abstract Time getTime(int parameterIndex)

Gets the value of a specified JDBC TIME parameter as a java.sql.Time.

abstract Timestamp getTimestamp(int parameterIndex, Calendar cal)

Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.

abstract Timestamp getTimestamp(String parameterName)

Returns the named parameter's TIMESTAMP value as a java.sql.Timestamp.

abstract Timestamp getTimestamp(String parameterName, Calendar cal)

Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.

abstract Timestamp getTimestamp(int parameterIndex)

Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.

abstract URL getURL(int parameterIndex)

Gets the value of a specified JDBC DATALINK parameter as a java.net.URL.

abstract URL getURL(String parameterName)

Returns the named parameter's JDBC DATALINK value in a new Java java.net.URL.

abstract void registerOutParameter(String parameterName, int sqlType)

Defines the Type of a specified OUT parameter.

abstract void registerOutParameter(int parameterIndex, int sqlType)

Defines the type of a specified OUT parameter.

abstract void registerOutParameter(String parameterName, int sqlType, String typeName)

Defines the Type of a specified OUT parameter.

abstract void registerOutParameter(String parameterName, int sqlType, int scale)

Defines the Type of a specified OUT parameter.

abstract void registerOutParameter(int parameterIndex, int sqlType, int scale)

Defines the Type of a specified OUT parameter.

abstract void registerOutParameter(int paramIndex, int sqlType, String typeName)

Defines the Type of a specified OUT parameter.

abstract void setAsciiStream(String parameterName, InputStream theInputStream, int length)

Sets the value of a specified parameter to the content of a supplied InputStream, which has a specified number of bytes.

abstract void setAsciiStream(String parameterName, InputStream x)

Sets the named parameter to the bytes from the given reader.

abstract void setAsciiStream(String parameterName, InputStream x, long length)

Sets the named parameter to the next length bytes from the given inputStream.

abstract void setBigDecimal(String parameterName, BigDecimal theBigDecimal)

Sets the value of a specified parameter to a supplied java.math.BigDecimal value.

abstract void setBinaryStream(String parameterName, InputStream x)

Sets the named parameter to the bytes from the given reader.

abstract void setBinaryStream(String parameterName, InputStream x, long length)

Sets the named parameter to the next length bytes from the given inputStream.

abstract void setBinaryStream(String parameterName, InputStream theInputStream, int length)

Sets the value of a specified parameter to the content of a supplied binary InputStream, which has a specified number of bytes.

abstract void setBlob(String parameterName, InputStream inputStream, long length)

Sets the named parameter to the next length bytes from the given inputStream.

abstract void setBlob(String parameterName, InputStream inputStream)

Sets the named parameter to the bytes from the given inputStream.

abstract void setBlob(String parameterName, Blob blob)

Sets the named parameter to the given blob.

abstract void setBoolean(String parameterName, boolean theBoolean)

Sets the value of a specified parameter to a supplied boolean value.

abstract void setByte(String parameterName, byte theByte)

Sets the value of a specified parameter to a supplied byte value.

abstract void setBytes(String parameterName, byte[] theBytes)

Sets the value of a specified parameter to a supplied array of bytes.

abstract void setCharacterStream(String parameterName, Reader reader, int length)

Sets the value of a specified parameter to the character content of a Reader object, with the specified length of character data.

abstract void setCharacterStream(String parameterName, Reader reader, long length)

Sets the named parameter to the next length characters from the given reader.

abstract void setCharacterStream(String parameterName, Reader reader)

Sets the named parameter to the characters from the given reader.

abstract void setClob(String parameterName, Reader reader, long length)

Sets the named parameter to the next length characters from the given reader.

abstract void setClob(String parameterName, Clob clob)

Sets the named parameter to the given clob.

abstract void setClob(String parameterName, Reader reader)

Sets the named parameter to the characters from the given reader.

abstract void setDate(String parameterName, Date theDate, Calendar cal)

Sets the value of a specified parameter to a supplied java.sql.Date value, using a supplied calendar to map the date.

abstract void setDate(String parameterName, Date theDate)

Sets the value of a specified parameter to a supplied java.sql.Date value.

abstract void setDouble(String parameterName, double theDouble)

Sets the value of a specified parameter to a supplied double value.

abstract void setFloat(String parameterName, float theFloat)

Sets the value of a specified parameter to to a supplied float value.

abstract void setInt(String parameterName, int theInt)

Sets the value of a specified parameter to a supplied int value.

abstract void setLong(String parameterName, long theLong)

Sets the value of a specified parameter to a supplied long value.

abstract void setNCharacterStream(String parameterName, Reader value)

Sets the named parameter to the characters from the given reader.

abstract void setNCharacterStream(String parameterName, Reader reader, long length)

Sets the named parameter to the characters from the given reader.

abstract void setNClob(String parameterName, Reader reader, long length)

Sets the named parameter to the next length characters from the given reader.

abstract void setNClob(String parameterName, NClob nclob)

Sets the named parameter to the given nclob.

abstract void setNClob(String parameterName, Reader reader)

Sets the named parameter to the characters from the given reader.

abstract void setNString(String parameterName, String string)

Sets the named parameter to the given string.

abstract void setNull(String parameterName, int sqlType)

Sets the value of a specified parameter to SQL NULL.

abstract void setNull(String parameterName, int sqlType, String typeName)

Sets the value of a specified parameter to be SQL NULL where the parameter type is either REF or user defined (e.g.

abstract void setObject(String parameterName, Object theObject)

Sets the value of a specified parameter using a supplied object.

abstract void setObject(String parameterName, Object theObject, int targetSqlType)

Sets the value of a specified parameter using a supplied object.

abstract void setObject(String parameterName, Object theObject, int targetSqlType, int scale)

Sets the value of a specified parameter using a supplied object.

abstract void setRowId(String parameterName, RowId rowId)

Sets the named parameter to the given rowId.

abstract void setSQLXML(String parameterName, SQLXML sqlXml)

Sets the named parameter to the given sqlXml.

abstract void setShort(String parameterName, short theShort)

Sets the value of a specified parameter to a supplied short value.

abstract void setString(String parameterName, String theString)

Sets the value of a specified parameter to a supplied String.

abstract void setTime(String parameterName, Time theTime, Calendar cal)

Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time using the supplied calendar.

abstract void setTime(String parameterName, Time theTime)

Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time.

abstract void setTimestamp(String parameterName, Timestamp theTimestamp, Calendar cal)

Sets the value of a specified parameter to a supplied java.sql.Timestamp value, using the supplied calendar.

abstract void setTimestamp(String parameterName, Timestamp theTimestamp)

Sets the value of a specified parameter to a supplied java.sql.Timestamp value.

abstract void setURL(String parameterName, URL theURL)

Sets the value of a specified parameter to the supplied java.net.URL.

abstract boolean wasNull()

Gets whether the value of the last OUT parameter read was SQL NULL.

Inherited methods

From interface java.sql.PreparedStatement
From interface java.sql.Statement
From interface java.sql.Wrapper
From interface java.lang.AutoCloseable

Public methods

getArray

Added in API level 1
Array getArray (int parameterIndex)

Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.

Parameters
parameterIndex int: the parameter index, where the first parameter has index 1.
Returns
Array a java.sql.Array containing the parameter value.
Throws
SQLException if a database error occurs.

getArray

Added in API level 1
Array getArray (String parameterName)

Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.

Parameters
parameterName String: the desired parameter's name.
Returns
Array a java.sql.Array containing the parameter's value.
Throws
SQLException if there is a problem accessing the database.

getBigDecimal

Added in API level 1
BigDecimal getBigDecimal (String parameterName)

Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input name.

Parameters
parameterName String: the desired parameter's name.
Returns
BigDecimal a java.math.BigDecimal representing the value of the specified parameter. The value null is returned if the parameter in question is an SQL NULL.
Throws
SQLException if a database error occurs.

getBigDecimal

Added in API level 1
BigDecimal getBigDecimal (int parameterIndex, 
                int scale)

This method was deprecated in API level 1.
Use getBigDecimal(int) or getBigDecimal(String) instead.

Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input index. The number of digits after the decimal point is specified by scale.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
scale int: the number of digits after the decimal point to get.
Returns
BigDecimal a java.math.BigDecimal representing the value of the specified parameter. The value null is returned if the parameter in question is an SQL NULL.
Throws
SQLException if a database error occurs.

getBigDecimal

Added in API level 1
BigDecimal getBigDecimal (int parameterIndex)

Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input index.

Parameters
parameterIndex int: the parameter number index where the first parameter has index 1.
Returns
BigDecimal a java.math.BigDecimal representing the value of the specified parameter. The value null is returned if the parameter in question is an SQL NULL.
Throws
SQLException if a database error occurs.

getBlob

Added in API level 1
Blob getBlob (String parameterName)

Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob.

Parameters
parameterName String: the desired parameter's name.
Returns
Blob a java.sql.Blob representing the value of the specified parameter. The value null is returned if the parameter in question is an SQL NULL.
Throws
SQLException if a database error occurs.

getBlob

Added in API level 1
Blob getBlob (int parameterIndex)

Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
Blob a java.sql.Blob representing the value of the specified parameter. The value null is returned if the parameter in question is an SQL NULL.
Throws
SQLException if a database error occurs.

getBoolean

Added in API level 1
boolean getBoolean (int parameterIndex)

Gets the value of a specified JDBC BIT parameter as a boolean.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
boolean a boolean representing the parameter value. false is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getBoolean

Added in API level 1
boolean getBoolean (String parameterName)

Gets the value of a specified JDBC BIT parameter as a boolean.

Parameters
parameterName String: the desired parameter's name.
Returns
boolean a boolean representation of the value of the parameter. false is returned if the SQL value is NULL.
Throws
SQLException if a database error occurs.

getByte

Added in API level 1
byte getByte (String parameterName)

Gets the value of a specified JDBC TINYINT parameter as a Java byte.

Parameters
parameterName String: the desired parameter's name.
Returns
byte a byte representation of the value of the parameter. 0 is returned if the SQL value is NULL.
Throws
SQLException if a database error occurs.

getByte

Added in API level 1
byte getByte (int parameterIndex)

Gets the value of a specified JDBC TINYINT parameter as a byte.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
byte a byte representation of the value of the parameter. 0 is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getBytes

Added in API level 1
byte[] getBytes (int parameterIndex)

Returns a byte array representation of the indexed JDBC BINARY or VARBINARY parameter.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
byte[] an array of bytes giving the value of the parameter. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getBytes

Added in API level 1
byte[] getBytes (String parameterName)

Returns a byte array representation of the named JDBC BINARY or VARBINARY parameter.

Parameters
parameterName String: the name of the parameter.
Returns
byte[] an array of bytes giving the value of the parameter. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getCharacterStream

Added in API level 9
Reader getCharacterStream (String parameterName)

Returns the value of the specified parameter as a java.io.Reader.

Parameters
parameterName String: the parameter name
Returns
Reader
Throws
SQLException if a database error occurs

getCharacterStream

Added in API level 9
Reader getCharacterStream (int parameterIndex)

Returns the value of the specified parameter as a java.io.Reader.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
Reader
Throws
SQLException if a database error occurs.

getClob

Added in API level 1
Clob getClob (int parameterIndex)

Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
Clob a java.sql.Clob representing the value of the parameter. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

See also:

getClob

Added in API level 1
Clob getClob (String parameterName)

Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob.

Parameters
parameterName String: the name of the parameter.
Returns
Clob a java.sql.Clob with the value of the parameter. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

See also:

getDate

Added in API level 1
Date getDate (int parameterIndex, 
                Calendar cal)

Gets the value of the specified JDBC DATE parameter as a java.sql.Date, using the specified Calendar to construct the date.

The JDBC driver uses the calendar to create the Date using a particular timezone and locale. The default behavior of the driver is to use the VM defaults. See "Be wary of the default locale".

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
cal Calendar: the Calendar to use to construct the date
Returns
Date the java.sql.Date giving the parameter's value. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

See also:

getDate

Added in API level 1
Date getDate (int parameterIndex)

Gets the value of the specified JDBC DATE parameter as a java.sql.Date.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
Date the java.sql.Date representing the parameter's value. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

See also:

getDate

Added in API level 1
Date getDate (String parameterName, 
                Calendar cal)

Gets the value of the specified JDBC DATE parameter as a java.sql.Date, using the specified Calendar to construct the date.

The JDBC driver uses the calendar to create the date using a particular timezone and locale. The default behavior of the driver is to use the VM defaults. See "Be wary of the default locale".

Parameters
parameterName String: the name of the desired parameter.
cal Calendar: used for creating the returned Date.
Returns
Date the java.sql.Date giving the parameter's value. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

See also:

getDate

Added in API level 1
Date getDate (String parameterName)

Gets the value of the specified JDBC DATE parameter as a java.sql.Date.

Parameters
parameterName String: the name of the desired parameter.
Returns
Date the java.sql.Date giving the parameter's value. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

See also:

getDouble

Added in API level 1
double getDouble (String parameterName)

Gets the value of the specified JDBC DOUBLE parameter as a double.

Parameters
parameterName String: the name of the desired parameter.
Returns
double the parameter's value as a double. 0.0 is returned if the value is SQL NULL.
Throws
SQLException if there is a problem accessing the database.

getDouble

Added in API level 1
double getDouble (int parameterIndex)

Gets the value of the specified JDBC DOUBLE parameter as a double.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
double the parameter's value as a double. 0.0 is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getFloat

Added in API level 1
float getFloat (int parameterIndex)

Gets the value of the specified JDBC FLOAT parameter as a float.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
float the parameter's value as a float. 0.0 is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getFloat

Added in API level 1
float getFloat (String parameterName)

Gets the value of the specified JDBC FLOAT parameter as a Java float.

Parameters
parameterName String: the name of the desired parameter.
Returns
float the parameter's value as a float. 0.0 is returned if the value is SQL NULL.
Throws
SQLException if there is a problem accessing the database.

getInt

Added in API level 1
int getInt (String parameterName)

Gets the value of the specified JDBC INTEGER parameter as an int.

Parameters
parameterName String: the name of the desired parameter.
Returns
int the int giving the parameter's value. 0 is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getInt

Added in API level 1
int getInt (int parameterIndex)

Gets the value of the specified JDBC INTEGER parameter as an int.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
int the int giving the parameter's value. 0 is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getLong

Added in API level 1
long getLong (String parameterName)

Gets the value of the specified JDBC BIGINT parameter as a long.

Parameters
parameterName String: the name of the desired parameter.
Returns
long the long giving the parameter's value. 0 is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getLong

Added in API level 1
long getLong (int parameterIndex)

Gets the value of the specified JDBC BIGINT parameter as a long.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
long the long giving the parameter's value. 0 is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getNCharacterStream

Added in API level 9
Reader getNCharacterStream (int parameterIndex)

Returns the value of the specified SQL NCHAR, NVARCHAR, or LONGNVARCHAR parameter as a Reader.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
Reader
Throws
SQLException if a database error occurs.

getNCharacterStream

Added in API level 9
Reader getNCharacterStream (String parameterName)

Returns the value of the specified SQL NCHAR, NVARCHAR, or LONGNVARCHAR parameter as a java.io.Reader.

Parameters
parameterName String: the parameter name
Returns
Reader
Throws
SQLException if a database error occurs

getNClob

Added in API level 9
NClob getNClob (String parameterName)

Returns the value of the specified SQL NCLOB parameter as a java.sql.NClob.

Parameters
parameterName String: the parameter name
Returns
NClob
Throws
SQLException if a database error occurs

getNClob

Added in API level 9
NClob getNClob (int parameterIndex)

Returns the value of the specified SQL NCLOB parameter as a java.sql.NClob.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
NClob
Throws
SQLException if a database error occurs.

getNString

Added in API level 9
String getNString (String parameterName)

Returns the value of the specified SQL NCHAR, NVARCHAR, or LONGNVARCHAR parameter as a java.lang.String.

Parameters
parameterName String: the parameter name
Returns
String
Throws
SQLException if a database error occurs

getNString

Added in API level 9
String getNString (int parameterIndex)

Returns the value of the specified SQL NCHAR, NVARCHAR, or LONGNVARCHAR parameter as a java.lang.String.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
String
Throws
SQLException if a database error occurs.

getObject

Added in API level 1
Object getObject (String parameterName, 
                Map<StringClass<?>> map)

Gets the value of a specified parameter as an Object. The actual return type is determined by the Map parameter which gives the correspondence between SQL types and Java classes.

Parameters
parameterName String: the parameter name.
map Map: the Map of SQL types to their Java counterparts
Returns
Object an Object holding the value of the parameter.
Throws
SQLException if there is a problem accessing the database.

getObject

Added in API level 1
Object getObject (int parameterIndex, 
                Map<StringClass<?>> map)

Gets the value of the specified parameter as an Object. The Map gives the correspondence between SQL types and Java classes.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
map Map: the Map giving the correspondence between SQL types and Java classes.
Returns
Object an Object holding the value of the parameter.
Throws
SQLException if a database error occurs.

getObject

Added in API level 1
Object getObject (String parameterName)

Gets the value of the specified parameter as an Object.

The object type returned is the JDBC type that was registered for the parameter by an earlier call to registerOutParameter(int, int). If a parameter was registered as a java.sql.Types.OTHER then it may hold abstract types that are particular to the connected database.

Parameters
parameterName String: the parameter name.
Returns
Object the Java Object representation of the value of the parameter.
Throws
SQLException if there is a problem accessing the database.

getObject

Added in API level 1
Object getObject (int parameterIndex)

Gets the value of the specified parameter as a Java Object.

The object type returned is the JDBC type registered for the parameter with a registerOutParameter call. If a parameter was registered as a java.sql.Types.OTHER then it may hold abstract types that are particular to the connected database.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
Object an Object holding the value of the parameter.
Throws
SQLException if a database error occurs.

getRef

Added in API level 1
Ref getRef (String parameterName)

Gets the value of a specified SQL REF() parameter as a java.sql.Ref.

Parameters
parameterName String: the desired parameter's name.
Returns
Ref the parameter's value in the form of a java.sql.Ref. A null reference is returned if the parameter's value is SQL NULL.
Throws
SQLException if there is a problem accessing the database.

See also:

getRef

Added in API level 1
Ref getRef (int parameterIndex)

Gets the value of a specified SQL REF() parameter as a java.sql.Ref.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
Ref a java.sql.Ref with the parameter value. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

getRowId

Added in API level 9
RowId getRowId (String parameterName)

Returns the value of the specified SQL ROWID parameter as a java.sql.RowId.

Parameters
parameterName String: the parameter name
Returns
RowId
Throws
SQLException if a database error occurs

getRowId

Added in API level 9
RowId getRowId (int parameterIndex)

Gets the value of a specified ROWID parameter as a java.sql.RowId.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
RowId
Throws
SQLException if a database error occurs.

getSQLXML

Added in API level 9
SQLXML getSQLXML (String parameterName)

Returns the value of the specified SQL XML parameter as a java.sql.SQLXML.

Parameters
parameterName String: the parameter name
Returns
SQLXML
Throws
SQLException if a database error occurs

getSQLXML

Added in API level 9
SQLXML getSQLXML (int parameterIndex)

Returns the value of the specified SQL XML parameter as a java.sql.SQLXML.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
SQLXML
Throws
SQLException if a database error occurs.

getShort

Added in API level 1
short getShort (String parameterName)

Gets the value of a specified JDBC SMALLINT parameter as a short.

Parameters
parameterName String: the desired parameter's name.
Returns
short the parameter's value as a short. 0 is returned if the parameter's value is SQL NULL.
Throws
SQLException if there is a problem accessing the database.

getShort

Added in API level 1
short getShort (int parameterIndex)

Gets the value of a specified JDBC SMALLINT parameter as a short.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
short the parameter's value as a short. 0 is returned if the parameter's value is SQL NULL.
Throws
SQLException if a database error occurs.

getString

Added in API level 1
String getString (int parameterIndex)

Returns the indexed parameter's value as a String. The parameter value must be one of the JDBC types CHAR, VARCHAR or LONGVARCHAR.

The String corresponding to a CHAR of fixed length will be of identical length to the value in the database inclusive of padding characters.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
String the parameter's value as a String. null is returned if the value is SQL NULL.
Throws
SQLException if there is a problem accessing the database.

getString

Added in API level 1
String getString (String parameterName)

Returns the named parameter's value as a string. The parameter value must be one of the JDBC types CHAR, VARCHAR or LONGVARCHAR.

The string corresponding to a CHAR of fixed length will be of identical length to the value in the database inclusive of padding characters.

Parameters
parameterName String: the desired parameter's name.
Returns
String the parameter's value as a String. null is returned if the value is SQL NULL.
Throws
SQLException if there is a problem accessing the database.

getTime

Added in API level 1
Time getTime (String parameterName, 
                Calendar cal)

Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time. The JDBC driver uses the calendar to handle specific timezones and locales when creating Time.

Parameters
parameterName String: the name of the desired parameter.
cal Calendar: used for creating the returned Time
Returns
Time a new java.sql.Time with the parameter's value. A null reference is returned for an SQL value of NULL.
Throws
SQLException if a database error occurs.

See also:

getTime

Added in API level 1
Time getTime (String parameterName)

Gets the value of a specified JDBC TIME parameter as a java.sql.Time.

Parameters
parameterName String: the name of the desired parameter.
Returns
Time a new java.sql.Time with the parameter's value. A null reference is returned for an SQL value of NULL.
Throws
SQLException if a database error occurs.

See also:

getTime

Added in API level 1
Time getTime (int parameterIndex, 
                Calendar cal)

Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time. The JDBC driver uses the calendar to handle specific timezones and locales in order to determine Time.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
cal Calendar: the calendar to use in constructing Time.
Returns
Time the parameter's value as a java.sql.Time. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

See also:

getTime

Added in API level 1
Time getTime (int parameterIndex)

Gets the value of a specified JDBC TIME parameter as a java.sql.Time.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
Time the parameter's value as a java.sql.Time. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

See also:

getTimestamp

Added in API level 1
Timestamp getTimestamp (int parameterIndex, 
                Calendar cal)

Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp. The JDBC driver uses the supplied Calendar to handle specific timezones and locales when creating the result.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1
cal Calendar: used for creating the returned Timestamp
Returns
Timestamp the parameter's value as a java.sql.Timestamp. A null reference is returned for an SQL value of NULL.
Throws
SQLException if a database error occurs.

See also:

getTimestamp

Added in API level 1
Timestamp getTimestamp (String parameterName)

Returns the named parameter's TIMESTAMP value as a java.sql.Timestamp.

Parameters
parameterName String: the name of the desired parameter.
Returns
Timestamp the parameter's value as a java.sql.Timestamp. A null reference is returned for an SQL value of NULL.
Throws
SQLException if a database error occurs.

See also:

getTimestamp

Added in API level 1
Timestamp getTimestamp (String parameterName, 
                Calendar cal)

Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp. The JDBC driver uses the supplied Calendar to handle specific timezones and locales when creating the result.

Parameters
parameterName String: the name of the desired parameter.
cal Calendar: used for creating the returned Timestamp
Returns
Timestamp the parameter's value as a java.sql.Timestamp. A null reference is returned for an SQL value of NULL.
Throws
SQLException if a database error occurs.

See also:

getTimestamp

Added in API level 1
Timestamp getTimestamp (int parameterIndex)

Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1
Returns
Timestamp the parameter's value as a java.sql.Timestamp. A null reference is returned for an SQL value of NULL.
Throws
SQLException if a database error occurs.

See also:

getURL

Added in API level 1
URL getURL (int parameterIndex)

Gets the value of a specified JDBC DATALINK parameter as a java.net.URL.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1.
Returns
URL a URL giving the parameter's value. null is returned if the value is SQL NULL.
Throws
SQLException if a database error occurs.

See also:

getURL

Added in API level 1
URL getURL (String parameterName)

Returns the named parameter's JDBC DATALINK value in a new Java java.net.URL.

Parameters
parameterName String: the name of the desired parameter.
Returns
URL a new java.net.URL encapsulating the parameter value. A null reference is returned for an SQL value of NULL.
Throws
SQLException if a database error occurs.

See also:

registerOutParameter

Added in API level 1
void registerOutParameter (String parameterName, 
                int sqlType)

Defines the Type of a specified OUT parameter. All OUT parameters must have their Type defined before a stored procedure is executed.

The type supplied in the sqlType parameter fixes the type that will be returned by the getter methods of CallableStatement. If a database-specific type is expected for a parameter, the Type java.sql.Types.OTHER should be used. Note that there is another variant of this method for User Defined Types or a REF type.

Parameters
parameterName String: the parameter name.
sqlType int: a JDBC type expressed as a constant from Types. Types NUMERIC and DECIMAL should be defined using the variant of this method that takes a scale parameter.
Throws
SQLException if a database error occurs.

registerOutParameter

Added in API level 1
void registerOutParameter (int parameterIndex, 
                int sqlType)

Defines the type of a specified OUT parameter. All OUT parameters must have their type defined before a stored procedure is executed.

The type supplied in the sqlType parameter fixes the type that will be returned by the getter methods of CallableStatement. If a database specific type is expected for a parameter, the Type java.sql.Types.OTHER should be used. Note that there is another variant of this method for User Defined Types or a REF type.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1
sqlType int: the JDBC type as defined by java.sql.Types. The JDBC types NUMERIC and DECIMAL should be defined using registerOutParameter(int, int, int).
Throws
SQLException if a database error occurs.

See also:

registerOutParameter

Added in API level 1
void registerOutParameter (String parameterName, 
                int sqlType, 
                String typeName)

Defines the Type of a specified OUT parameter. This variant of the method is designed for use with parameters that are User Defined Types (UDT) or a REF type, although it can be used for any type.

Parameters
parameterName String: the parameter name
sqlType int: a JDBC type expressed as a constant from Types
typeName String: the fully qualified name of an SQL structured type. For a REF type, this name should be the fully qualified name of the referenced type.
Throws
SQLException if a database error occurs.

registerOutParameter

Added in API level 1
void registerOutParameter (String parameterName, 
                int sqlType, 
                int scale)

Defines the Type of a specified OUT parameter. All OUT parameters must have their Type defined before a stored procedure is executed. This version of the registerOutParameter method, which has a scale parameter, should be used for the JDBC types NUMERIC and DECIMAL, where there is a need to specify the number of digits expected after the decimal point.

The type supplied in the sqlType parameter fixes the type that will be returned by the getter methods of CallableStatement.

Parameters
parameterName String: the parameter name.
sqlType int: a JDBC type expressed as a constant from Types.
scale int: the number of digits after the decimal point. Must be greater than or equal to 0.
Throws
SQLException if a database error occurs.

registerOutParameter

Added in API level 1
void registerOutParameter (int parameterIndex, 
                int sqlType, 
                int scale)

Defines the Type of a specified OUT parameter. All OUT parameters must have their type defined before a stored procedure is executed. This version of the registerOutParameter method, which has a scale parameter, should be used for the JDBC types NUMERIC and DECIMAL, where there is a need to specify the number of digits expected after the decimal point.

The type supplied in the sqlType parameter fixes the type that will be returned by the getter methods of CallableStatement.

Parameters
parameterIndex int: the parameter number index, where the first parameter has index 1
sqlType int: the JDBC type as defined by java.sql.Types.
scale int: the number of digits after the decimal point. Must be greater than or equal to 0.
Throws
SQLException if a database error occurs.

See also:

registerOutParameter

Added in API level 1
void registerOutParameter (int paramIndex, 
                int sqlType, 
                String typeName)

Defines the Type of a specified OUT parameter. This variant of the method is designed for use with parameters that are User Defined Types (UDT) or a REF type, although it can be used for any type.

Parameters
paramIndex int: the parameter number index, where the first parameter has index 1.
sqlType int: a JDBC type expressed as a constant from Types.
typeName String: an SQL type name. For a REF type, this name should be the fully qualified name of the referenced type.
Throws
SQLException if a database error occurs.

See also:

setAsciiStream

Added in API level 1
void setAsciiStream (String parameterName, 
                InputStream theInputStream, 
                int length)

Sets the value of a specified parameter to the content of a supplied InputStream, which has a specified number of bytes.

This is a good method for setting an SQL LONGVARCHAR parameter where the length of the data is large. Data is read from the InputStream until end-of-file is reached or the specified number of bytes is copied.

Parameters
parameterName String: the parameter name
theInputStream InputStream: the ASCII input stream carrying the data to update the parameter with.
length int: the number of bytes in the InputStream to copy to the parameter.
Throws
SQLException if a database error occurs.

setAsciiStream

Added in API level 9
void setAsciiStream (String parameterName, 
                InputStream x)

Sets the named parameter to the bytes from the given reader.

Parameters
parameterName String
x InputStream
Throws
SQLException if a database error occurs

setAsciiStream

Added in API level 9
void setAsciiStream (String parameterName, 
                InputStream x, 
                long length)

Sets the named parameter to the next length bytes from the given inputStream.

Parameters
parameterName String
x InputStream
length long
Throws
SQLException if a database error occurs

setBigDecimal

Added in API level 1
void setBigDecimal (String parameterName, 
                BigDecimal theBigDecimal)

Sets the value of a specified parameter to a supplied java.math.BigDecimal value.

Parameters
parameterName String: the name of the parameter.
theBigDecimal BigDecimal: the java.math.BigInteger value to set.
Throws
SQLException if a database error occurs.

setBinaryStream

Added in API level 9
void setBinaryStream (String parameterName, 
                InputStream x)

Sets the named parameter to the bytes from the given reader.

Parameters
parameterName String
x InputStream
Throws
SQLException if a database error occurs

setBinaryStream

Added in API level 9
void setBinaryStream (String parameterName, 
                InputStream x, 
                long length)

Sets the named parameter to the next length bytes from the given inputStream.

Parameters
parameterName String
x InputStream
length long
Throws
SQLException if a database error occurs

setBinaryStream

Added in API level 1
void setBinaryStream (String parameterName, 
                InputStream theInputStream, 
                int length)

Sets the value of a specified parameter to the content of a supplied binary InputStream, which has a specified number of bytes.

Use this method when a large amount of data needs to be set into a LONGVARBINARY parameter.

Parameters
parameterName String: the name of the parameter.
theInputStream InputStream: the binary InputStream carrying the data to update the parameter.
length int: the number of bytes in the InputStream to copy to the parameter.
Throws
SQLException if a database error occurs.

setBlob

Added in API level 9
void setBlob (String parameterName, 
                InputStream inputStream, 
                long length)

Sets the named parameter to the next length bytes from the given inputStream.

Parameters
parameterName String
inputStream InputStream
length long
Throws
SQLException if a database error occurs

setBlob

Added in API level 9
void setBlob (String parameterName, 
                InputStream inputStream)

Sets the named parameter to the bytes from the given inputStream.

Parameters
parameterName String
inputStream InputStream
Throws
SQLException if a database error occurs

setBlob

Added in API level 9
void setBlob (String parameterName, 
                Blob blob)

Sets the named parameter to the given blob.

Parameters
parameterName String
blob Blob
Throws
SQLException if a database error occurs

setBoolean

Added in API level 1
void setBoolean (String parameterName, 
                boolean theBoolean)

Sets the value of a specified parameter to a supplied boolean value.

Parameters
parameterName String: the parameter name.
theBoolean boolean: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

setByte

Added in API level 1
void setByte (String parameterName, 
                byte theByte)

Sets the value of a specified parameter to a supplied byte value.

Parameters
parameterName String: the parameter name.
theByte byte: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

setBytes

Added in API level 1
void setBytes (String parameterName, 
                byte[] theBytes)

Sets the value of a specified parameter to a supplied array of bytes. The array is mapped to VARBINARY or else LONGVARBINARY in the connected database.

Parameters
parameterName String: the parameter name.
theBytes byte: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

setCharacterStream

Added in API level 1
void setCharacterStream (String parameterName, 
                Reader reader, 
                int length)

Sets the value of a specified parameter to the character content of a Reader object, with the specified length of character data.

Parameters
parameterName String: the parameter name.
reader Reader: the new value with which to update the parameter.
length int: a count of the characters contained in reader.
Throws
SQLException if a database error occurs.

setCharacterStream

Added in API level 9
void setCharacterStream (String parameterName, 
                Reader reader, 
                long length)

Sets the named parameter to the next length characters from the given reader.

Parameters
parameterName String
reader Reader
length long
Throws
SQLException if a database error occurs

setCharacterStream

Added in API level 9
void setCharacterStream (String parameterName, 
                Reader reader)

Sets the named parameter to the characters from the given reader.

Parameters
parameterName String
reader Reader
Throws
SQLException if a database error occurs

setClob

Added in API level 9
void setClob (String parameterName, 
                Reader reader, 
                long length)

Sets the named parameter to the next length characters from the given reader.

Parameters
parameterName String
reader Reader
length long
Throws
SQLException if a database error occurs

setClob

Added in API level 9
void setClob (String parameterName, 
                Clob clob)

Sets the named parameter to the given clob.

Parameters
parameterName String
clob Clob
Throws
SQLException if a database error occurs

setClob

Added in API level 9
void setClob (String parameterName, 
                Reader reader)

Sets the named parameter to the characters from the given reader.

Parameters
parameterName String
reader Reader
Throws
SQLException if a database error occurs

setDate

Added in API level 1
void setDate (String parameterName, 
                Date theDate, 
                Calendar cal)

Sets the value of a specified parameter to a supplied java.sql.Date value, using a supplied calendar to map the date. The calendar allows the application to control the timezone used to compute the SQL DATE in the database. In case that no calendar is supplied, the driver uses the default timezone of the Java virtual machine.

Parameters
parameterName String: the parameter name.
theDate Date: the new value with which to update the parameter.
cal Calendar: a Calendar to use to construct the SQL DATE value.
Throws
SQLException if a database error occurs.

See also:

setDate

Added in API level 1
void setDate (String parameterName, 
                Date theDate)

Sets the value of a specified parameter to a supplied java.sql.Date value.

Parameters
parameterName String: the parameter name.
theDate Date: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

setDouble

Added in API level 1
void setDouble (String parameterName, 
                double theDouble)

Sets the value of a specified parameter to a supplied double value.

Parameters
parameterName String: the parameter name.
theDouble double: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

setFloat

Added in API level 1
void setFloat (String parameterName, 
                float theFloat)

Sets the value of a specified parameter to to a supplied float value.

Parameters
parameterName String: the parameter name.
theFloat float: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

setInt

Added in API level 1
void setInt (String parameterName, 
                int theInt)

Sets the value of a specified parameter to a supplied int value.

Parameters
parameterName String: the parameter name.
theInt int: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

setLong

Added in API level 1
void setLong (String parameterName, 
                long theLong)

Sets the value of a specified parameter to a supplied long value.

Parameters
parameterName String: the parameter name.
theLong long: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

setNCharacterStream

Added in API level 9
void setNCharacterStream (String parameterName, 
                Reader value)

Sets the named parameter to the characters from the given reader.

Parameters
parameterName String
value Reader
Throws
SQLException if a database error occurs

setNCharacterStream

Added in API level 9
void setNCharacterStream (String parameterName, 
                Reader reader, 
                long length)

Sets the named parameter to the characters from the given reader.

Parameters
parameterName String
reader Reader
length long
Throws
SQLException if a database error occurs

setNClob

Added in API level 9
void setNClob (String parameterName, 
                Reader reader, 
                long length)

Sets the named parameter to the next length characters from the given reader.

Parameters
parameterName String
reader Reader
length long
Throws
SQLException if a database error occurs

setNClob

Added in API level 9
void setNClob (String parameterName, 
                NClob nclob)

Sets the named parameter to the given nclob.

Parameters
parameterName String
nclob NClob
Throws
SQLException if a database error occurs

setNClob

Added in API level 9
void setNClob (String parameterName, 
                Reader reader)

Sets the named parameter to the characters from the given reader.

Parameters
parameterName String
reader Reader
Throws
SQLException if a database error occurs

setNString

Added in API level 9
void setNString (String parameterName, 
                String string)

Sets the named parameter to the given string.

Parameters
parameterName String
string String
Throws
SQLException if a database error occurs

setNull

Added in API level 1
void setNull (String parameterName, 
                int sqlType)

Sets the value of a specified parameter to SQL NULL. Don't use this version of setNull for User Defined Types (UDT) or for REF type parameters.

Parameters
parameterName String: the parameter name.
sqlType int: a JDBC type expressed as a constant from Types.
Throws
SQLException if a database error occurs.

setNull

Added in API level 1
void setNull (String parameterName, 
                int sqlType, 
                String typeName)

Sets the value of a specified parameter to be SQL NULL where the parameter type is either REF or user defined (e.g. STRUCT , JAVA_OBJECT etc).

For reasons of portability, the caller is expected to supply both the SQL type code and type name (which is just the parameter name if the type is user defined, referred to as a UDT, or the name of the referenced type in case of a REF type).

Parameters
parameterName String: the parameter name.
sqlType int: a JDBC type expressed as a constant from Types.
typeName String: if the target parameter is a user defined type then this should contain the full type name. The fully qualified name of a UDT or REF type is ignored if the parameter is not a UDT.
Throws
SQLException if a database error occurs.

See also:

setObject

Added in API level 1
void setObject (String parameterName, 
                Object theObject)

Sets the value of a specified parameter using a supplied object. Prior to issuing this request to the connected database theObject is transformed to the corresponding SQL type according to the standard Java to SQL mapping rules.

If the object's class implements the interface SQLData, the JDBC driver calls SQLData.writeSQL to write it to the SQL data stream. If theObject implements any of the following interfaces then the driver is in charge of mapping the value to the appropriate SQL type.

Parameters
parameterName String: the parameter name
theObject Object: the new value with which to update the parameter
Throws
SQLException if a database error occurs.

See also:

setObject

Added in API level 1
void setObject (String parameterName, 
                Object theObject, 
                int targetSqlType)

Sets the value of a specified parameter using a supplied object.

The parameter theObject is converted to the given targetSqlType before it is sent to the database. If the object has a custom mapping (its class implements the interface SQLData), the JDBC driver calls the method SQLData.writeSQL to write it to the SQL data stream. If theObject is an instance of one of the following types

then the driver is in charge of mapping the value to the appropriate SQL type and deliver it to the database.

Parameters
parameterName String: the parameter name.
theObject Object: the new value with which to update the parameter.
targetSqlType int: a JDBC type expressed as a constant from Types.
Throws
SQLException if a database error occurs.

See also:

setObject

Added in API level 1
void setObject (String parameterName, 
                Object theObject, 
                int targetSqlType, 
                int scale)

Sets the value of a specified parameter using a supplied object.

The object is converted to the given targetSqlType before it is sent to the database. If the object has a custom mapping (its class implements the interface SQLData), the JDBC driver calls the method SQLData.writeSQL to write it to the SQL data stream. If theObject implements any of the following interfaces

then the driver is charge of mapping the value to the appropriate SQL type.

Parameters
parameterName String: the parameter name.
theObject Object: the new value with which to update the parameter.
targetSqlType int: a JDBC type expressed as a constant from Types.
scale int: where applicable, the number of digits after the decimal. point.
Throws
SQLException if a database error occurs.

See also:

setRowId

Added in API level 9
void setRowId (String parameterName, 
                RowId rowId)

Sets the named parameter to the given rowId.

Parameters
parameterName String
rowId RowId
Throws
SQLException if a database error occurs

setSQLXML

Added in API level 9
void setSQLXML (String parameterName, 
                SQLXML sqlXml)

Sets the named parameter to the given sqlXml.

Parameters
parameterName String
sqlXml SQLXML
Throws
SQLException if a database error occurs

setShort

Added in API level 1
void setShort (String parameterName, 
                short theShort)

Sets the value of a specified parameter to a supplied short value.

Parameters
parameterName String: the name of the parameter.
theShort short: a short value to update the parameter.
Throws
SQLException if a database error occurs.

setString

Added in API level 1
void setString (String parameterName, 
                String theString)

Sets the value of a specified parameter to a supplied String.

Parameters
parameterName String: the name of the parameter.
theString String: a String value to update the parameter.
Throws
SQLException if a database error occurs.

setTime

Added in API level 1
void setTime (String parameterName, 
                Time theTime, 
                Calendar cal)

Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time using the supplied calendar.

The driver uses the supplied Calendar to create the SQL TIME value, which allows it to use a custom timezone - otherwise the driver uses the VM defaults. See "Be wary of the default locale".

Parameters
parameterName String: the parameter name.
theTime Time: the new value with which to update the parameter.
cal Calendar: used for creating the new SQL TIME value.
Throws
SQLException if a database error occurs.

See also:

setTime

Added in API level 1
void setTime (String parameterName, 
                Time theTime)

Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time.

Parameters
parameterName String: the parameter name.
theTime Time: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

See also:

setTimestamp

Added in API level 1
void setTimestamp (String parameterName, 
                Timestamp theTimestamp, 
                Calendar cal)

Sets the value of a specified parameter to a supplied java.sql.Timestamp value, using the supplied calendar.

The driver uses the supplied calendar to create the SQL TIMESTAMP value, which allows it to use a custom timezone - otherwise the driver uses the VM defaults. See "Be wary of the default locale".

Parameters
parameterName String: the parameter name.
theTimestamp Timestamp: the new value with which to update the parameter.
cal Calendar: used for creating the new SQL TIME value.
Throws
SQLException if a database error occurs.

See also:

setTimestamp

Added in API level 1
void setTimestamp (String parameterName, 
                Timestamp theTimestamp)

Sets the value of a specified parameter to a supplied java.sql.Timestamp value.

Parameters
parameterName String: the parameter name.
theTimestamp Timestamp: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

See also:

setURL

Added in API level 1
void setURL (String parameterName, 
                URL theURL)

Sets the value of a specified parameter to the supplied java.net.URL.

Parameters
parameterName String: the parameter name.
theURL URL: the new value with which to update the parameter.
Throws
SQLException if a database error occurs.

See also:

wasNull

Added in API level 1
boolean wasNull ()

Gets whether the value of the last OUT parameter read was SQL NULL.

Returns
boolean true if the last parameter was SQL NULL, false otherwise.
Throws
SQLException if a database error occurs.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.