|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.access.AS400JDBCStatement
com.ibm.as400.access.AS400JDBCPreparedStatement
com.ibm.as400.access.AS400JDBCCallableStatement
public class AS400JDBCCallableStatement
The AS400JDBCCallableStatement class runs a stored procedure. Use Connection.prepareCall() to create new CallableStatement objects.
Parameters are indexed sequentially, by number, starting at 1. The caller must register output parameters before executing the stored procedure.
The new JDK 1.4 methods add the ability to retrieve information by column name in addition to column index. Be aware you will see better performance accessing columns by their index rather than accessing them by their name.
Field Summary |
---|
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 | ||
---|---|---|
Array |
getArray(int parameterIndex)
|
|
Array |
getArray(String parameterName)
Returns the value of an SQL ARRAY output parameter as an Array value. |
|
BigDecimal |
getBigDecimal(int parameterIndex)
Returns the value of an SQL NUMERIC or DECIMAL output parameter as a BigDecimal object. |
|
BigDecimal |
getBigDecimal(int parameterIndex,
int scale)
Deprecated. Use getBigDecimal(int) or getBigDecimal(String) instead. |
|
BigDecimal |
getBigDecimal(String parameterName)
Returns the value of an SQL NUMERIC or DECIMAL output parameter as a BigDecimal object. |
|
Blob |
getBlob(int parameterIndex)
Returns the value of an SQL BLOB output parameter as a Blob value. |
|
Blob |
getBlob(String parameterName)
Returns the value of an SQL BLOB output parameter as a Blob value. |
|
boolean |
getBoolean(int parameterIndex)
Returns the value of an SQL SMALLINT output parameter as a Java boolean. |
|
boolean |
getBoolean(String parameterName)
Returns the value of an SQL SMALLINT output parameter as a Java boolean. |
|
byte |
getByte(int parameterIndex)
Returns the value of an SQL SMALLINT output parameter as a Java byte. |
|
byte |
getByte(String parameterName)
Returns the value of an SQL SMALLINT output parameter as a Java byte. |
|
byte[] |
getBytes(int parameterIndex)
Returns the value of an SQL BINARY or VARBINARY output parameter as a Java byte array. |
|
byte[] |
getBytes(String parameterName)
Returns the value of an SQL BINARY or VARBINARY output parameter as a Java byte array. |
|
Reader |
getCharacterStream(int parameterIndex)
Retrieves the value of the designated parameter as a java.io.Reader object in the Java programming language. |
|
Reader |
getCharacterStream(String parameterName)
Retrieves the value of the designated parameter as a java.io.Reader object in the Java programming language. |
|
Clob |
getClob(int parameterIndex)
Returns the value of an SQL CLOB output parameter as a Clob value. |
|
Clob |
getClob(String parameterName)
Returns the value of an SQL CLOB output parameter as a Clob value. |
|
Date |
getDate(int parameterIndex)
Returns the value of an SQL DATE output parameter as a java.sql.Date object using the default calendar. |
|
Date |
getDate(int parameterIndex,
Calendar calendar)
Returns the value of an SQL DATE output parameter as a java.sql.Date object using a calendar other than the default. |
|
Date |
getDate(String parameterName)
Returns the value of an SQL DATE output parameter as a java.sql.Date object using the default calendar. |
|
Date |
getDate(String parameterName,
Calendar calendar)
Returns the value of an SQL DATE output parameter as a java.sql.Date object using a calendar other than the default. |
|
double |
getDouble(int parameterIndex)
Returns the value of an SQL DOUBLE or FLOAT output parameter as a Java double. |
|
double |
getDouble(String parameterName)
Returns the value of an SQL DOUBLE or FLOAT output parameter as a Java double. |
|
float |
getFloat(int parameterIndex)
Returns the value of an SQL REAL or FLOAT output parameter as a Java float. |
|
float |
getFloat(String parameterName)
Returns the value of an SQL REAL or FLOAT output parameter as a Java float. |
|
int |
getInt(int parameterIndex)
Returns the value of an SQL INTEGER output parameter as a Java int. |
|
int |
getInt(String parameterName)
Returns the value of an SQL INTEGER output parameter as a Java int. |
|
long |
getLong(int parameterIndex)
If the connected system supports SQL BIGINT data, this returns the value of an SQL BIGINT output parameter as a Java long. |
|
long |
getLong(String parameterName)
If the connected system supports SQL BIGINT data, this returns the value of an SQL BIGINT output parameter as a Java long. |
|
Reader |
getNCharacterStream(int parameterIndex)
Retrieves the value of the designated parameter as a java.io.Reader object in the Java programming language. |
|
Reader |
getNCharacterStream(String parameterName)
Retrieves the value of the designated parameter as a java.io.Reader object in the Java programming language. |
|
NClob |
getNClob(int parameterIndex)
Retrieves the value of the designated JDBC NCLOB parameter as a
java.sql.NClob object in the Java programming language. |
|
NClob |
getNClob(String parameterName)
Retrieves the value of a JDBC NCLOB parameter as a
java.sql.NClob object in the Java programming language. |
|
String |
getNString(int parameterIndex)
Retrieves the value of the designated NCHAR ,
NVARCHAR
or LONGNVARCHAR parameter as
a String in the Java programming language. |
|
String |
getNString(String parameterName)
Retrieves the value of the designated NCHAR ,
NVARCHAR
or LONGNVARCHAR parameter as
a String in the Java programming language. |
|
Object |
getObject(int parameterIndex)
Returns the value of an output parameter as a Java Object. |
|
Object |
getObject(int parameterIndex,
Map typeMap)
Returns the value of an output parameter as a Java Object. |
|
Object |
getObject(String parameterName)
Returns the value of an output parameter as a Java Object. |
|
Object |
getObject(String parameterName,
Map typeMap)
Returns the value of an output parameter as a Java Object. |
|
Ref |
getRef(int parameterIndex)
Returns the value of an SQL REF output parameter as a Ref value. |
|
Ref |
getRef(String parameterName)
Returns the value of an SQL REF output parameter as a Ref value. |
|
RowId |
getRowId(int parameterIndex)
Retrieves the value of the designated JDBC ROWID parameter as a
java.sql.RowId object. |
|
RowId |
getRowId(String parameterName)
Retrieves the value of the designated JDBC ROWID parameter as a
java.sql.RowId object. |
|
short |
getShort(int parameterIndex)
Returns the value of an SQL SMALLINT output parameter as a Java short value. |
|
short |
getShort(String parameterName)
Returns the value of an SQL SMALLINT output parameter as a Java short value. |
|
SQLXML |
getSQLXML(int parameterIndex)
Retrieves the value of the designated SQL XML parameter as a
java.sql.SQLXML object in the Java programming language. |
|
SQLXML |
getSQLXML(String parameterName)
Retrieves the value of the designated SQL XML parameter as a
java.sql.SQLXML object in the Java programming language. |
|
String |
getString(int parameterIndex)
Returns the value of an SQL CHAR or VARCHAR output parameter as a Java String object. |
|
String |
getString(String parameterName)
Returns the value of an SQL CHAR or VARCHAR output parameter as a Java String object. |
|
Time |
getTime(int parameterIndex)
Returns the value of an SQL TIME output parameter as a java.sql.Time object using the default calendar. |
|
Time |
getTime(int parameterIndex,
Calendar calendar)
Returns the value of an SQL TIME output parameter as a java.sql.Time object using a calendar other than the default. |
|
Time |
getTime(String parameterName)
Returns the value of an SQL TIME output parameter as a java.sql.Time object using the default calendar. |
|
Time |
getTime(String parameterName,
Calendar calendar)
Returns the value of an SQL TIME output parameter as a java.sql.Time object using a calendar other than the default. |
|
Timestamp |
getTimestamp(int parameterIndex)
Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using the default calendar. |
|
Timestamp |
getTimestamp(int parameterIndex,
Calendar calendar)
Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using a calendar other than the default. |
|
Timestamp |
getTimestamp(String parameterName)
Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using the default calendar. |
|
Timestamp |
getTimestamp(String parameterName,
Calendar calendar)
Returns the value of an SQL TIMESTAMP output parameter as a java.sql.Timestamp object using a calendar other than the default. |
|
URL |
getURL(int parameterIndex)
Returns the value of an SQL DATALINK output parameter as a java.net.URL object. |
|
URL |
getURL(String parameterName)
Returns the value of an SQL DATALINK output parameter as a java.net.URL object. |
|
protected String[] |
getValidWrappedList()
|
|
boolean |
isWrapperFor(Class<?> iface)
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. |
|
void |
registerOutParameter(int parameterIndex,
int sqlType)
Registers the type for an output parameter. |
|
void |
registerOutParameter(int parameterIndex,
int sqlType,
int scale)
Registers the type for an output parameter. |
|
void |
registerOutParameter(int parameterIndex,
int sqlType,
String typeName)
Registers the type for an output parameter. |
|
void |
registerOutParameter(String parameterName,
int sqlType)
Registers the type for an output parameter. |
|
void |
registerOutParameter(String parameterName,
int sqlType,
int scale)
Registers the type for an output parameter. |
|
void |
registerOutParameter(String parameterName,
int sqlType,
String typeName)
Registers the type for an output parameter. |
|
void |
setAsciiStream(String parameterName,
InputStream x)
Sets the designated parameter to the given input stream. |
|
void |
setAsciiStream(String parameterName,
InputStream parameterValue,
int length)
Sets an input parameter to an ASCII stream value. |
|
void |
setAsciiStream(String parameterName,
InputStream x,
long length)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
|
void |
setBigDecimal(String parameterName,
BigDecimal parameterValue)
Sets an input parameter to a BigDecimal value. |
|
void |
setBinaryStream(String parameterName,
InputStream x)
Sets the designated parameter to the given input stream. |
|
void |
setBinaryStream(String parameterName,
InputStream parameterValue,
int length)
Sets an input parameter to a binary stream value. |
|
void |
setBinaryStream(String parameterName,
InputStream x,
long length)
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
|
void |
setBlob(String parameterName,
Blob x)
Sets the designated parameter to the given java.sql.Blob object. |
|
void |
setBlob(String parameterName,
InputStream inputStream)
Sets the designated parameter to a InputStream object. |
|
void |
setBlob(String parameterName,
InputStream inputStream,
long length)
Sets the designated parameter to a InputStream object. |
|
void |
setBoolean(String parameterName,
boolean parameterValue)
Sets an input parameter to a Java boolean value. |
|
void |
setByte(String parameterName,
byte parameterValue)
Sets an input parameter to a Java byte value. |
|
void |
setBytes(String parameterName,
byte[] parameterValue)
Sets an input parameter to a Java byte array value. |
|
void |
setCharacterStream(String parameterName,
Reader reader)
Sets the designated parameter to the given Reader
object. |
|
void |
setCharacterStream(String parameterName,
Reader parameterValue,
int length)
Sets an input parameter to a character stream value. |
|
void |
setCharacterStream(String parameterName,
Reader reader,
long length)
Sets the designated parameter to the given Reader
object, which is the given number of characters long. |
|
void |
setClob(String parameterName,
Clob x)
Sets the designated parameter to the given java.sql.Clob object. |
|
void |
setClob(String parameterName,
Reader reader)
Sets the designated parameter to a Reader object. |
|
void |
setClob(String parameterName,
Reader reader,
long length)
Sets the designated parameter to a Reader object. |
|
void |
setDate(String parameterName,
Date parameterValue)
Sets an input parameter to a java.sql.Date value using the default calendar. |
|
void |
setDate(String parameterName,
Date parameterValue,
Calendar cal)
Sets an input parameter to a java.sql.Date value using a calendar other than the default. |
|
void |
setDouble(String parameterName,
double parameterValue)
Sets an input parameter to a Java double value. |
|
void |
setFloat(String parameterName,
float parameterValue)
Sets an input parameter to a Java float value. |
|
void |
setInt(String parameterName,
int parameterValue)
Sets an input parameter to a Java int value. |
|
void |
setLong(String parameterName,
long parameterValue)
Sets an input parameter to a Java long value. |
|
void |
setNCharacterStream(String parameterName,
Reader value)
Sets the designated parameter to a Reader object. |
|
void |
setNCharacterStream(String parameterName,
Reader value,
long length)
Sets the designated parameter to a Reader object. |
|
void |
setNClob(String parameterName,
NClob value)
Sets the designated parameter to a java.sql.NClob object. |
|
void |
setNClob(String parameterName,
Reader reader)
Sets the designated parameter to a Reader object. |
|
void |
setNClob(String parameterName,
Reader reader,
long length)
Sets the designated parameter to a Reader object. |
|
void |
setNString(String parameterName,
String value)
Sets the designated parameter to the given String object. |
|
void |
setNull(String parameterName,
int sqlType)
Sets an input parameter to SQL NULL. |
|
void |
setNull(String parameterName,
int sqlType,
String typeName)
Sets an input parameter to SQL NULL. |
|
void |
setObject(String parameterName,
Object parameterValue)
Sets an input parameter to an Object value. |
|
void |
setObject(String parameterName,
Object parameterValue,
int targetSqlType)
Sets an input parameter to an Object value. |
|
void |
setObject(String parameterName,
Object parameterValue,
int targetSqlType,
int scale)
Sets an input parameter to an Object value. |
|
void |
setRowId(String parameterName,
RowId x)
Sets the designated parameter to the given java.sql.RowId object. |
|
void |
setShort(String parameterName,
short parameterValue)
Sets an input parameter to a Java short value. |
|
void |
setSQLXML(String parameterName,
SQLXML xmlObject)
Sets the designated parameter to the given java.sql.SQLXML object. |
|
void |
setString(String parameterName,
String parameterValue)
Sets an input parameter to a String value. |
|
void |
setTime(String parameterName,
Time parameterValue)
Sets an input parameter to a java.sql.Time value using the default calendar. |
|
void |
setTime(String parameterName,
Time parameterValue,
Calendar cal)
Sets an input parameter to a java.sql.Time value using a calendar other than the default. |
|
void |
setTimestamp(String parameterName,
Timestamp parameterValue)
Sets an input parameter to a java.sql.Timestamp value using the default calendar. |
|
void |
setTimestamp(String parameterName,
Timestamp parameterValue,
Calendar cal)
Sets an input parameter to a java.sql.Timestamp value using a calendar other than the default. |
|
void |
setURL(String parameterName,
URL parameterValue)
Sets an input parameter to a URL value. |
|
|
unwrap(Class<T> iface)
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. |
|
boolean |
wasNull()
Indicates if the last parameter read has the value of SQL NULL. |
Methods inherited from class com.ibm.as400.access.AS400JDBCPreparedStatement |
---|
addBatch, addBatch, clearParameters, close, execute, execute, execute, executeBatch, executeQuery, executeQuery, executeUpdate, executeUpdate, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDB2Default, setDB2Unassigned, setDBDefault, setDBUnassigned, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.sql.PreparedStatement |
---|
addBatch, clearParameters, execute, executeQuery, executeUpdate, 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, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL |
Methods inherited from interface java.sql.Wrapper |
---|
isWrapperFor, unwrap |
Method Detail |
---|
public Array getArray(int parameterIndex) throws SQLException
getArray
in interface CallableStatement
SQLException
public Array getArray(String parameterName) throws SQLException
getArray
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- Always thrown because DB2 for IBM i does not support arrays.public BigDecimal getBigDecimal(int parameterIndex) throws SQLException
getBigDecimal
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException
getBigDecimal
in interface CallableStatement
parameterIndex
- The parameter index (1-based).scale
- The number of digits after the decimal.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the scale is not valid,
the statement was not executed, or
the requested conversion is not valid.getBigDecimal(int)
public BigDecimal getBigDecimal(String parameterName) throws SQLException
getBigDecimal
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Blob getBlob(int parameterIndex) throws SQLException
getBlob
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Blob getBlob(String parameterName) throws SQLException
getBlob
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public boolean getBoolean(int parameterIndex) throws SQLException
getBoolean
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public boolean getBoolean(String parameterName) throws SQLException
getBoolean
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public byte getByte(int parameterIndex) throws SQLException
getByte
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid,
or an error occurs.public byte getByte(String parameterName) throws SQLException
getByte
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid,
or an error occurs.public byte[] getBytes(int parameterIndex) throws SQLException
getBytes
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public byte[] getBytes(String parameterName) throws SQLException
getBytes
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Clob getClob(int parameterIndex) throws SQLException
getClob
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Clob getClob(String parameterName) throws SQLException
getClob
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Date getDate(int parameterIndex) throws SQLException
getDate
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Date getDate(int parameterIndex, Calendar calendar) throws SQLException
getDate
in interface CallableStatement
parameterIndex
- The parameter index (1-based).calendar
- The calendar.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed,
the calendar is null, or
the requested conversion is not valid.public Date getDate(String parameterName) throws SQLException
getDate
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Date getDate(String parameterName, Calendar calendar) throws SQLException
getDate
in interface CallableStatement
parameterName
- The parameter name.calendar
- The calendar.
SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed,
the calendar is null, or
the requested conversion is not valid.public double getDouble(int parameterIndex) throws SQLException
getDouble
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public double getDouble(String parameterName) throws SQLException
getDouble
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public float getFloat(int parameterIndex) throws SQLException
getFloat
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public float getFloat(String parameterName) throws SQLException
getFloat
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public int getInt(int parameterIndex) throws SQLException
getInt
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public int getInt(String parameterName) throws SQLException
getInt
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public long getLong(int parameterIndex) throws SQLException
getLong
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public long getLong(String parameterName) throws SQLException
getLong
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Object getObject(int parameterIndex) throws SQLException
getObject
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Object getObject(int parameterIndex, Map typeMap) throws SQLException
getObject
in interface CallableStatement
parameterIndex
- The parameter index (1-based).typeMap
- The type map. This is not used.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Object getObject(String parameterName) throws SQLException
getObject
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Object getObject(String parameterName, Map typeMap) throws SQLException
getObject
in interface CallableStatement
parameterName
- The parameter name.typeMap
- The type map. This is not used.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Ref getRef(int parameterIndex) throws SQLException
getRef
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- Always thrown because DB2 for IBM i does not support REFs.public Ref getRef(String parameterName) throws SQLException
getRef
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- Always thrown because DB2 for IBM i does not support REFs.public short getShort(int parameterIndex) throws SQLException
getShort
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public short getShort(String parameterName) throws SQLException
getShort
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public String getString(int parameterIndex) throws SQLException
getString
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public String getString(String parameterName) throws SQLException
getString
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Time getTime(int parameterIndex) throws SQLException
getTime
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Time getTime(int parameterIndex, Calendar calendar) throws SQLException
getTime
in interface CallableStatement
parameterIndex
- The parameter index (1-based).calendar
- The calendar.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed,
the calendar is null, or
the requested conversion is not valid.public Time getTime(String parameterName) throws SQLException
getTime
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Time getTime(String parameterName, Calendar calendar) throws SQLException
getTime
in interface CallableStatement
parameterName
- The parameter name.calendar
- The calendar.
SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed,
the calendar is null, or
the requested conversion is not valid.public Timestamp getTimestamp(int parameterIndex) throws SQLException
getTimestamp
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Timestamp getTimestamp(int parameterIndex, Calendar calendar) throws SQLException
getTimestamp
in interface CallableStatement
parameterIndex
- The parameter index (1-based).calendar
- The calendar.
SQLException
- If the statement is not open,
the index is not valid, the index is
not registered as an output parameter,
the statement was not executed,
the calendar is null, or
the requested conversion is not valid.public Timestamp getTimestamp(String parameterName) throws SQLException
getTimestamp
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed, or
the requested conversion is not valid.public Timestamp getTimestamp(String parameterName, Calendar calendar) throws SQLException
getTimestamp
in interface CallableStatement
parameterName
- The parameter name.calendar
- The calendar.
SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed,
the calendar is null, or
the requested conversion is not valid.public URL getURL(int parameterIndex) throws SQLException
getURL
in interface CallableStatement
parameterIndex
- The parameter index (1-based).
SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed or
the requested conversion is not valid.public URL getURL(String parameterName) throws SQLException
getURL
in interface CallableStatement
parameterName
- The parameter name.
SQLException
- If the statement is not open,
the name is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed or
the requested conversion is not valid.public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException
registerOutParameter
in interface CallableStatement
parameterIndex
- The parameter index (1-based).sqlType
- The SQL type code defined in java.sql.Types.scale
- The number of digits after the decimal
if sqlType is DECIMAL or NUMERIC.
SQLException
- If the index is not valid,
the scale is not valid,
the parameter is not an output parameter,
or the requested conversion is not valid.public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException
registerOutParameter
in interface CallableStatement
parameterIndex
- The parameter index (1-based).sqlType
- The SQL type code defined in java.sql.Types.
SQLException
- If the index is not valid,
the parameter is not an output parameter,
or the requested conversion is not valid.public void registerOutParameter(int parameterIndex, int sqlType, String typeName) throws SQLException
registerOutParameter
in interface CallableStatement
parameterIndex
- The parameter index (1-based).sqlType
- The SQL type code defined in java.sql.Types.typeName
- The fully-qualified name of an SQL structured type. This value will be ignored.
SQLException
- If the index is not valid,
the parameter is not an output parameter,
or the requested conversion is not valid.public void registerOutParameter(String parameterName, int sqlType) throws SQLException
registerOutParameter
in interface CallableStatement
parameterName
- The parameter name.sqlType
- The SQL type code defined in java.sql.Types.
SQLException
- If the index is not valid,
the parameter is not an output parameter,
or the requested conversion is not valid.public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException
registerOutParameter
in interface CallableStatement
parameterName
- The parameter name.sqlType
- The SQL type code defined in java.sql.Types.scale
- The number of digits after the decimal
if sqlType is DECIMAL or NUMERIC.
SQLException
- If the index is not valid,
the scale is not valid,
the parameter is not an output parameter,
or the requested conversion is not valid.public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException
registerOutParameter
in interface CallableStatement
parameterName
- The parameter name.sqlType
- The SQL type code defined in java.sql.Types.typeName
- The fully-qualified name of an SQL structured type. This value will be ignored.
SQLException
- If the index is not valid,
the parameter is not an output parameter,
or the requested conversion is not valid.public void setAsciiStream(String parameterName, InputStream parameterValue, int length) throws SQLException
setAsciiStream
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.length
- The number of bytes in the stream.
SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter,
the length is not valid,
the input stream does not contain all
ASCII characters, or an error occurs
while reading the input stream.public void setBigDecimal(String parameterName, BigDecimal parameterValue) throws SQLException
setBigDecimal
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.
SQLException
- If the statement is not open,
the index is not valid, or the parameter
is not an input parameter.public void setBinaryStream(String parameterName, InputStream parameterValue, int length) throws SQLException
setBinaryStream
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.length
- The number of bytes in the stream.
SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter,
the length is not valid, or
an error occurs while reading the
input stream.public void setBoolean(String parameterName, boolean parameterValue) throws SQLException
setBoolean
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value.
SQLException
- If the statement is not open,
the parameterName is not valid, or
the parameter is not an input parameter.public void setByte(String parameterName, byte parameterValue) throws SQLException
setByte
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value.
SQLException
- If the statement is not open,
the parameter name is not valid, or
the parameter is not an input parameter.public void setBytes(String parameterName, byte[] parameterValue) throws SQLException
setBytes
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.
SQLException
- If the statement is not open,
the parameter name is not valid, or the parameter
is not an input parameter.public void setCharacterStream(String parameterName, Reader parameterValue, int length) throws SQLException
setCharacterStream
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.length
- The number of bytes in the reader.
SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter,
the length is not valid,
or an error occurs while reading the
character streampublic void setDate(String parameterName, Date parameterValue) throws SQLException
setDate
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.
SQLException
- If the statement is not open,
the parameter name is not valid, or the parameter
is not an input parameter.public void setDate(String parameterName, Date parameterValue, Calendar cal) throws SQLException
setDate
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.cal
- The calendar.
SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter,
or the calendar is null.public void setDouble(String parameterName, double parameterValue) throws SQLException
setDouble
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value.
SQLException
- If the statement is not open,
the parameter name is not valid or
the parameter is not an input parameter.public void setFloat(String parameterName, float parameterValue) throws SQLException
setFloat
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value.
SQLException
- If the statement is not open,
the parameter name is not valid, or
the parameter is not an input parameter.public void setInt(String parameterName, int parameterValue) throws SQLException
setInt
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value.
SQLException
- If the statement is not open,
the parameter name is not valid or
the parameter is not an input parameter.public void setLong(String parameterName, long parameterValue) throws SQLException
setLong
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value.
SQLException
- If the statement is not open,
the parameter name is not valid, or
the parameter is not an input parameter.public void setNull(String parameterName, int sqlType) throws SQLException
setNull
in interface CallableStatement
parameterName
- The parameter name.sqlType
- The SQL type code defined in java.sql.Types.
SQLException
- If the statement is not open,
the parameterName is not valid,
the parameter is not an input parameter,
or the SQL type is not valid.public void setNull(String parameterName, int sqlType, String typeName) throws SQLException
setNull
in interface CallableStatement
parameterName
- The parameter name.sqlType
- The SQL type code defined in java.sql.Types.typeName
- The fully-qualified name of an SQL structured type. This value will be ignored.
SQLException
- If the statement is not open,
the index is not valid,
the parameter is not an input parameter,
or the SQL type is not valid.public void setObject(String parameterName, Object parameterValue) throws SQLException
setObject
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.
SQLException
- If the statement is not open,
the index is not valid,
the parameter is not an input parameter,
the type of value is not supported,
or the parameter is not serializable
(when proxy support is in use).public void setObject(String parameterName, Object parameterValue, int targetSqlType) throws SQLException
setObject
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.targetSqlType
- The SQL type code defined in java.sql.Types.
SQLException
- If the statement is not open,
the index is not valid,
the parameter is not an input parameter,
the SQL type is not valid,
the scale is not valid,
or the parameter is not serializable
(when proxy support is in use).public void setObject(String parameterName, Object parameterValue, int targetSqlType, int scale) throws SQLException
setObject
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.targetSqlType
- The SQL type code defined in java.sql.Types.scale
- The number of digits after the decimal
if sqlType is DECIMAL or NUMERIC.
SQLException
- If the statement is not open,
the index is not valid,
the parameter is not an input parameter,
the SQL type is not valid,
the scale is not valid,
or the parameter is not serializable
(when proxy support is in use).public void setShort(String parameterName, short parameterValue) throws SQLException
setShort
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value.
SQLException
- If the statement is not open,
the parameter name is not valid or
the parameter is not an input parameter.public void setString(String parameterName, String parameterValue) throws SQLException
setString
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.
SQLException
- If the statement is not open,
the parameter name is not valid, or the parameter
is not an input parameter.public void setTime(String parameterName, Time parameterValue) throws SQLException
setTime
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.
SQLException
- If the statement is not open,
the parameter name is not valid, or the parameter
is not an input parameter.public void setTime(String parameterName, Time parameterValue, Calendar cal) throws SQLException
setTime
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.cal
- The calendar.
SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter,
or the calendar is null.public void setTimestamp(String parameterName, Timestamp parameterValue) throws SQLException
setTimestamp
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.
SQLException
- If the statement is not open,
the parameter name is not valid, or the parameter
is not an input parameter.public void setTimestamp(String parameterName, Timestamp parameterValue, Calendar cal) throws SQLException
setTimestamp
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.cal
- The calendar.
SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter,
or the calendar is null.public void setURL(String parameterName, URL parameterValue) throws SQLException
setURL
in interface CallableStatement
parameterName
- The parameter name.parameterValue
- The parameter value or null to set
the value to SQL NULL.
SQLException
- If the statement is not open,
the parameter name is not valid, or the parameter
is not an input parameter.public boolean wasNull() throws SQLException
wasNull
in interface CallableStatement
SQLException
- If the statement is not open.protected String[] getValidWrappedList()
getValidWrappedList
in class AS400JDBCPreparedStatement
public Reader getCharacterStream(int parameterIndex) throws SQLException
java.io.Reader
object in the Java programming language.
getCharacterStream
in interface CallableStatement
parameterIndex
- the first parameter is 1, the second is 2, ...
java.io.Reader
object that contains the parameter
value; if the value is SQL NULL
, the value returned is
null
in the Java programming language.
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
public Reader getCharacterStream(String parameterName) throws SQLException
java.io.Reader
object in the Java programming language.
getCharacterStream
in interface CallableStatement
parameterName
- the name of the parameter
java.io.Reader
object that contains the parameter
value; if the value is SQL NULL
, the value returned is
null
in the Java programming language
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic Reader getNCharacterStream(int parameterIndex) throws SQLException
java.io.Reader
object in the Java programming language.
It is intended for use when
accessing NCHAR
,NVARCHAR
and LONGNVARCHAR
parameters.
getNCharacterStream
in interface CallableStatement
parameterIndex
- the first parameter is 1, the second is 2, ...
java.io.Reader
object that contains the parameter
value; if the value is SQL NULL
, the value returned is
null
in the Java programming language.
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic Reader getNCharacterStream(String parameterName) throws SQLException
java.io.Reader
object in the Java programming language.
It is intended for use when
accessing NCHAR
,NVARCHAR
and LONGNVARCHAR
parameters.
getNCharacterStream
in interface CallableStatement
parameterName
- the name of the parameter
java.io.Reader
object that contains the parameter
value; if the value is SQL NULL
, the value returned is
null
in the Java programming language
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic NClob getNClob(int parameterIndex) throws SQLException
NCLOB
parameter as a
java.sql.NClob
object in the Java programming language.
getNClob
in interface CallableStatement
parameterIndex
- the first parameter is 1, the second is 2, and
so on
NClob
object in the
Java programming language. If the value was SQL NULL
, the
value null
is returned.
SQLException
- if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic NClob getNClob(String parameterName) throws SQLException
NCLOB
parameter as a
java.sql.NClob
object in the Java programming language.
getNClob
in interface CallableStatement
parameterName
- the name of the parameter
NClob
object in the
Java programming language. If the value was SQL NULL
,
the value null
is returned.
SQLException
- if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic String getNString(int parameterIndex) throws SQLException
NCHAR
,
NVARCHAR
or LONGNVARCHAR
parameter as
a String
in the Java programming language.
For the fixed-length type JDBC NCHAR
,
the String
object
returned has exactly the same value the SQL
NCHAR
value had in the
database, including any padding added by the database.
getNString
in interface CallableStatement
parameterIndex
- index of the first parameter is 1, the second is 2, ...
String
object that maps an
NCHAR
, NVARCHAR
or LONGNVARCHAR
value
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodsetNString(java.lang.String, java.lang.String)
public String getNString(String parameterName) throws SQLException
NCHAR
,
NVARCHAR
or LONGNVARCHAR
parameter as
a String
in the Java programming language.
For the fixed-length type JDBC NCHAR
,
the String
object
returned has exactly the same value the SQL
NCHAR
value had in the
database, including any padding added by the database.
getNString
in interface CallableStatement
parameterName
- the name of the parameter
String
object that maps an
NCHAR
, NVARCHAR
or LONGNVARCHAR
value
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodsetNString(java.lang.String, java.lang.String)
public RowId getRowId(int parameterIndex) throws SQLException
ROWID
parameter as a
java.sql.RowId
object.
getRowId
in interface CallableStatement
parameterIndex
- the first parameter is 1, the second is 2,...
RowId
object that represents the JDBC ROWID
value is used as the designated parameter. If the parameter contains
a SQL NULL
, then a null
value is returned.
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic RowId getRowId(String parameterName) throws SQLException
ROWID
parameter as a
java.sql.RowId
object.
getRowId
in interface CallableStatement
parameterName
- the name of the parameter
RowId
object that represents the JDBC ROWID
value is used as the designated parameter. If the parameter contains
a SQL NULL
, then a null
value is returned.
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic SQLXML getSQLXML(int parameterIndex) throws SQLException
SQL XML
parameter as a
java.sql.SQLXML
object in the Java programming language.
getSQLXML
in interface CallableStatement
parameterIndex
- index of the first parameter is 1, the second is 2, ...
SQLXML
object that maps an SQL XML
value
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic SQLXML getSQLXML(String parameterName) throws SQLException
SQL XML
parameter as a
java.sql.SQLXML
object in the Java programming language.
getSQLXML
in interface CallableStatement
parameterName
- the name of the parameter
SQLXML
object that maps an SQL XML
value
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException
LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream
. Data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from ASCII to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setAsciiStream
in interface CallableStatement
parameterName
- the name of the parameterx
- the Java input stream that contains the ASCII parameter valuelength
- the number of bytes in the stream
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setBinaryStream(String parameterName, InputStream x, long length) throws SQLException
LONGVARBINARY
parameter, it may be more practical to send it via a
java.io.InputStream
object. The data will be read from the stream
as needed until end-of-file is reached.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setBinaryStream
in interface CallableStatement
parameterName
- the name of the parameterx
- the java input stream which contains the binary parameter valuelength
- the number of bytes in the stream
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this method.public void setBlob(String parameterName, Blob x) throws SQLException
java.sql.Blob
object.
The driver converts this to an SQL BLOB
value when it
sends it to the database.
setBlob
in interface CallableStatement
parameterName
- the name of the parameterx
- a Blob
object that maps an SQL BLOB
value
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException
InputStream
object. The InputStream
must contain the number
of characters specified by length, otherwise a SQLException
will be
generated when the CallableStatement
is executed.
This method differs from the setBinaryStream (int, InputStream, int)
method because it informs the driver that the parameter value should be
sent to the system as a BLOB
. When the setBinaryStream
method is used,
the driver may have to do extra work to determine whether the parameter
data should be sent to the system as a LONGVARBINARY
or a BLOB
setBlob
in interface CallableStatement
parameterName
- the name of the parameter to be setinputStream
- An object that contains the data to set the parameter
value to.length
- the number of bytes in the parameter data.
SQLException
- if parameterIndex does not correspond
to a parameter marker in the SQL statement, or if the length specified
is less than zero; if the number of bytes in the inputStream does not match
the specfied length; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException
Reader
object, which is the given number of characters long.
When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader
object. The data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setCharacterStream
in interface CallableStatement
parameterName
- the name of the parameterreader
- the java.io.Reader
object that
contains the UNICODE data used as the designated parameterlength
- the number of characters in the stream
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setClob(String parameterName, Clob x) throws SQLException
java.sql.Clob
object.
The driver converts this to an SQL CLOB
value when it
sends it to the database.
setClob
in interface CallableStatement
parameterName
- the name of the parameterx
- a Clob
object that maps an SQL CLOB
value
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setClob(String parameterName, Reader reader, long length) throws SQLException
Reader
object. The reader
must contain the number
of characters specified by length otherwise a SQLException
will be
generated when the CallableStatement
is executed.
This method differs from the setCharacterStream (int, Reader, int)
method
because it informs the driver that the parameter value should be sent to
the system as a CLOB
. When the setCharacterStream
method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the system as a LONGVARCHAR
or a CLOB
setClob
in interface CallableStatement
parameterName
- the name of the parameter to be setreader
- An object that contains the data to set the parameter value to.length
- the number of characters in the parameter data.
SQLException
- if parameterIndex does not correspond to a parameter
marker in the SQL statement; if the length specified is less than zero;
a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException
Reader
object. The
Reader
reads the data till end-of-file is reached. The
driver does the necessary conversion from Java character format to
the national character set in the database.
setNCharacterStream
in interface CallableStatement
parameterName
- the name of the parameter to be setvalue
- the parameter valuelength
- the number of characters in the parameter data.
SQLException
- if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setNClob(String parameterName, NClob value) throws SQLException
java.sql.NClob
object. The object
implements the java.sql.NClob
interface. This NClob
object maps to a SQL NCLOB
.
setNClob
in interface CallableStatement
parameterName
- the name of the parameter to be setvalue
- the parameter value
SQLException
- if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setNClob(String parameterName, Reader reader, long length) throws SQLException
Reader
object. The reader
must contain the number
of characters specified by length otherwise a SQLException
will be
generated when the CallableStatement
is executed.
This method differs from the setCharacterStream (int, Reader, int)
method
because it informs the driver that the parameter value should be sent to
the system as a NCLOB
. When the setCharacterStream
method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the system as a LONGNVARCHAR
or a NCLOB
setNClob
in interface CallableStatement
parameterName
- the name of the parameter to be setreader
- An object that contains the data to set the parameter value to.length
- the number of characters in the parameter data.
SQLException
- if parameterIndex does not correspond to a parameter
marker in the SQL statement; if the length specified is less than zero;
if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setNString(String parameterName, String value) throws SQLException
String
object.
The driver converts this to a SQL NCHAR
or
NVARCHAR
or LONGNVARCHAR
setNString
in interface CallableStatement
parameterName
- the name of the parameter to be setvalue
- the parameter value
SQLException
- if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setRowId(String parameterName, RowId x) throws SQLException
java.sql.RowId
object. The
driver converts this to a SQL ROWID
when it sends it to the
database.
setRowId
in interface CallableStatement
parameterName
- the name of the parameterx
- the parameter value
SQLException
- if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
java.sql.SQLXML
object. The driver converts this to an
SQL XML
value when it sends it to the database.
setSQLXML
in interface CallableStatement
parameterName
- the name of the parameterxmlObject
- a SQLXML
object that maps an SQL XML
value
SQLException
- if a database access error occurs,
this method is called on a closed CallableStatement
or
the java.xml.transform.Result
,
Writer
or OutputStream
has not been closed for the SQLXML
object
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void setAsciiStream(String parameterName, InputStream x) throws SQLException
LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream
. Data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from ASCII to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setAsciiStream
which takes a length parameter.
setAsciiStream
in interface CallableStatement
parameterName
- the name of the parameterx
- the Java input stream that contains the ASCII parameter value
SQLException
- if parameterName does not correspond to a named
parameter; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support this methodpublic void setBinaryStream(String parameterName, InputStream x) throws SQLException
LONGVARBINARY
parameter, it may be more practical to send it via a
java.io.InputStream
object. The data will be read from the
stream as needed until end-of-file is reached.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setBinaryStream
which takes a length parameter.
setBinaryStream
in interface CallableStatement
parameterName
- the name of the parameterx
- the java input stream which contains the binary parameter value
SQLException
- if parameterName does not correspond to a named
parameter; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support this methodpublic void setBlob(String parameterName, InputStream inputStream) throws SQLException
InputStream
object.
This method differs from the setBinaryStream (int, InputStream)
method because it informs the driver that the parameter value should be
sent to the system as a BLOB
. When the setBinaryStream
method is used,
the driver may have to do extra work to determine whether the parameter
data should be sent to the system as a LONGVARBINARY
or a BLOB
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setBlob
which takes a length parameter.
setBlob
in interface CallableStatement
parameterName
- the name of the parameterinputStream
- An object that contains the data to set the parameter
value to.
SQLException
- if parameterName does not correspond to a named
parameter; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support this methodpublic void setCharacterStream(String parameterName, Reader reader) throws SQLException
Reader
object.
When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader
object. The data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setCharacterStream
which takes a length parameter.
setCharacterStream
in interface CallableStatement
parameterName
- the name of the parameterreader
- the java.io.Reader
object that contains the
Unicode data
SQLException
- if parameterName does not correspond to a named
parameter; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support this methodpublic void setClob(String parameterName, Reader reader) throws SQLException
Reader
object.
This method differs from the setCharacterStream (int, Reader)
method
because it informs the driver that the parameter value should be sent to
the system as a CLOB
. When the setCharacterStream
method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the system as a LONGVARCHAR
or a CLOB
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setClob
which takes a length parameter.
setClob
in interface CallableStatement
parameterName
- the name of the parameterreader
- An object that contains the data to set the parameter value to.
SQLException
- if parameterName does not correspond to a named
parameter; if a database access error occurs or this method is called on
a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support this methodpublic void setNCharacterStream(String parameterName, Reader value) throws SQLException
Reader
object. The
Reader
reads the data till end-of-file is reached. The
driver does the necessary conversion from Java character format to
the national character set in the database.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setNCharacterStream
which takes a length parameter.
setNCharacterStream
in interface CallableStatement
parameterName
- the name of the parametervalue
- the parameter value
SQLException
- if parameterName does not correspond to a named
parameter; if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs; or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support this methodpublic void setNClob(String parameterName, Reader reader) throws SQLException
Reader
object.
This method differs from the setCharacterStream (int, Reader)
method
because it informs the driver that the parameter value should be sent to
the system as a NCLOB
. When the setCharacterStream
method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the system as a LONGNVARCHAR
or a NCLOB
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
setNClob
which takes a length parameter.
setNClob
in interface CallableStatement
parameterName
- the name of the parameterreader
- An object that contains the data to set the parameter value to.
SQLException
- if parameterName does not correspond to a named
parameter; if the driver does not support national character sets;
if the driver can detect that a data conversion
error could occur; if a database access error occurs or
this method is called on a closed CallableStatement
SQLFeatureNotSupportedException
- if the JDBC driver does not support this methodpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
on the wrapped object. If this does not
implement the interface and is not a wrapper, return false. This method
should be implemented as a low-cost operation compared to
unwrap
so that callers can use this method to avoid
expensive unwrap
calls that may fail. If this method
returns true then calling unwrap
with the same argument
should succeed.
isWrapperFor
in interface Wrapper
iface
- a Class defining an interface.
SQLException
- if an error occurs while determining whether this is a
wrapper for an object with the given interface.public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
recursively on the wrapped object or a
proxy for that result. If the receiver is not a wrapper and does not
implement the interface, then an SQLException
is thrown.
unwrap
in interface Wrapper
iface
- A Class defining an interface that the result must implement.
SQLException
- If no object found that implements the interface
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |