Interface OracleCallableStatement
- All Superinterfaces:
AutoCloseable,CallableStatement,OracleCommonPreparedStatement,OracleCommonStatement,OraclePreparedStatement,OracleStatement,PreparedStatement,Statement,Wrapper
OraclePreparedStatement (which
extends the OracleStatement interface) and incorporates standard
JDBC callable statement functionality. It is used to execute SQL stored
procedure.
Oracle JDBC drivers support execution of PL/SQL stored procedures and anonymous blocks. They support both SQL92 escape syntax and Oracle PL/SQL block syntax. The following PL/SQL calls would work with any Oracle JDBC driver:
// SQL92 syntax
CallableStatement cs1 = conn.prepareCall
( "{call proc (?,?)}" ) ; // stored proc
CallableStatement cs2 = conn.prepareCall
( "{? = call func (?,?)}" ) ; // stored func
// Oracle PL/SQL block syntax
CallableStatement cs3 = conn.prepareCall
( "begin proc (?,?); end;" ) ; // stored proc
CallableStatement cs4 = conn.prepareCall
( "begin ? := func(?,?); end;" ) ; // stored func
As an example of using Oracle syntax, here is a PL/SQL code snippet that creates a stored function. The PL/SQL function gets a character sequence and concatenates a suffix to it:
create or replace function foo (val1 char) return char as begin return val1 || 'suffix'; end;
Your invocation call in your JDBC program should look like:
Connection conn = DriverManager.getConnection
("jdbc:oracle:oci8:@", "scott", "tiger");
CallableStatement cs = conn.prepareCall ("begin ? := foo(?); end;");
cs.registerOutParameter(1,Types.CHAR);
cs.setString(2, "aa");
cs.executeUpdate();
String result = cs.getString(1);
- Since:
- 8.1.7
- See Also:
-
Field Summary
Fields inherited from interface oracle.jdbc.OraclePreparedStatement
FORM_CHAR, FORM_NCHARFields inherited from interface oracle.jdbc.OracleStatement
EXPLICIT, IMPLICIT, NEWFields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO -
Method Summary
Modifier and TypeMethodDescriptiongetAnyDataEmbeddedObject(int parameterIndex) Deprecated.As of Oracle 11R1 there is full support for ANYTYPE and ANYDATA.getARRAY(int parameterIndex) Retrieves data into anoracle.sql.ARRAYobject.getAsciiStream(int parameterIndex) Retrieves data into anjava.io.InputStreamobject.getBfile(int parameterIndex) Retrieves data into anoracle.sql.BFILEobject.getBFILE(int parameterIndex) Retrieves data into anoracle.sql.BFILEobject.getBinaryStream(int parameterIndex) Retrieves data into anjava.io.InputStreamobject.getBinaryStream(String parameterName) Retrieves data into anjava.io.InputStreamobject.getBLOB(int parameterIndex) Retrieves data into anoracle.sql.BLOBobject.getCHAR(int parameterIndex) Retrieves data into anoracle.sql.CHARobject.getCharacterStream(int parameterIndex) Retrieves data into anjava.io.Readerobject.getCLOB(int parameterIndex) Retrieves data into anoracle.sql.CLOBobject.getCursor(int parameterIndex) Retrieves data into anjava.sql.ResultSetobject.getCustomDatum(int parameterIndex, CustomDatumFactory factory) Deprecated.getDATE(int parameterIndex) Retrieves data into anoracle.sql.DATEobject.getINTERVALDS(int parameterIndex) Retrieves data into anoracle.sql.INTERVALDSobject.getINTERVALYM(int parameterIndex) Retrieves data into anoracle.sql.INTERVALYMobject.getNUMBER(int parameterIndex) Retrieves data into anoracle.sql.NUMBERobject.getObject(int parameterIndex, OracleDataFactory factory) Returns an instance ofOracleData, which is returned by the factory's "create" methodgetOPAQUE(int parameterIndex) Retrieves data into anoracle.sql.OPAQUEobject.getOracleObject(int parameterIndex) Retrieves data into anoracle.sql.Datumobject.Datum[]getOraclePlsqlIndexTable(int paramIndex) Deprecated.since 18.1 Use java.sql.CallableStatement.getObject(int parameterIndex) method.getORAData(int parameterIndex, ORADataFactory factory) getPlsqlIndexTable(int paramIndex) Deprecated.since 18.1.getPlsqlIndexTable(int paramIndex, Class<?> primitiveType) Deprecated.since 18.1.getRAW(int parameterIndex) Retrieves data into anoracle.sql.RAWobject.getREF(int parameterIndex) Retrieves data into anoracle.sql.REFobject.getROWID(int parameterIndex) Retrieves data into anoracle.sql.ROWIDobject.getSTRUCT(int parameterIndex) Retrieves data into anoracle.sql.STRUCTobject.getTIMESTAMP(int paramIdx) Retrieves data into anoracle.sql.TIMESTAMPobject.getTIMESTAMPLTZ(int paramIdx) Retrieves data into anoracle.sql.TIMESTAMPLTZobject.getTIMESTAMPTZ(int paramIdx) Retrieves data into anoracle.sql.TIMESTAMPTZobject.getUnicodeStream(int parameterIndex) Retrieves data into anjava.io.InputStreamobject.getUnicodeStream(String parameterName) Retrieves data into anjava.io.InputStreamobject.voidregisterIndexTableOutParameter(int paramIndex, int maxLen, int elemSqlType, int elemMaxLen) Deprecated.since 18.1.voidregisterOutParameter(int paramIndex, int sqlType, int scale, int maxLength) Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns.voidregisterOutParameter(String parameterName, int sqlType, int scale, int maxLength) Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns.voidregisterOutParameterAtName(String parameterMarkerName, int sqlType) Special Oracle method to registerOutParameter by the parameterMarkerName of oracle style parameter markers instead of parameterIndex.voidregisterOutParameterAtName(String parameterMarkerName, int sqlType, int scale) Special Oracle method to registerOutParameter by the parameterMarkerName of oracle style parameter markers instead of parameterIndex.voidregisterOutParameterAtName(String parameterMarkerName, int sqlType, String typeName) Special Oracle method to registerOutParameter by the parameterMarkerName of oracle style parameter markers instead of parameterIndex.voidregisterOutParameterBytes(int paramIndex, int sqlType, int scale, int maxLength) Deprecated.As of Oracle 10g Release 1 all character values are measured in Java chars so this method is no longer supported.voidregisterOutParameterChars(int paramIndex, int sqlType, int scale, int maxLength) Deprecated.As of Oracle 10g Release 1 all character values are measured in Java chars so this method is no longer needed.voidSets the designated parameter to anjava.sql.Arrayvalue.voidSets the designated parameter to anoracle.sql.ARRAYvalue.voidsetAsciiStream(String parameterName, InputStream x, int y) Sets the designated parameter to the given input stream, which will have the specified number of bytes.voidSets the designated parameter to anoracle.sql.BFILEvalue.voidSets the designated parameter to anoracle.sql.BFILEvalue.voidsetBigDecimal(String parameterName, BigDecimal x) Sets the designated parameter to the givenjava.math.BigDecimalvalue.voidsetBinaryDouble(String parameterName, double x) Sets the designated parameter to the givenoracle.sql.BINARY_FLOATvalue.voidsetBinaryDouble(String parameterName, BINARY_DOUBLE x) Sets the designated parameter to the givenoracle.sql.BINARY_FLOATvalue.voidsetBinaryFloat(String parameterName, float x) Sets the designated parameter to the given Javafloatvalue.voidsetBinaryFloat(String parameterName, BINARY_FLOAT x) Sets the designated parameter to the givenoracle.sql.BINARY_FLOATvalue.voidsetBinaryStream(String parameterName, InputStream x, int y) Sets the designated parameter to the given input stream, which will have the specified number of bytes.voidSets the designated parameter to anjava.sql.Blobvalue.voidSets the designated parameter to anoracle.sql.BLOBvalue.voidsetBoolean(String parameterName, boolean x) Sets the designated parameter to the given Javabooleanvalue.voidSets the designated parameter to the given Javabytevalue.voidSets the designated parameter to the given Java array of bytes.voidsetBytesForBlob(String parameterName, byte[] x) Sets the designated parameter to the given Javabyte[]value.voidSets the designated parameter to anoracle.sql.CHARvalue.voidsetCharacterStream(String parameterName, Reader x, int y) Sets the designated parameter to the givenReaderobject, which is the given number of characters long.voidSets the designated parameter to anjava.sql.Clobvalue.voidSets the designated parameter to anoracle.sql.CLOBvalue.voidSets the designated parameter to a Java Cursor value.voidsetCustomDatum(String parameterName, CustomDatum x) Sets the designated parameter to anoracle.sql.CustomDatumvalue.voidSets the designated parameter to the givenjava.sql.Datevalue.voidSets the designated parameter to the givenjava.sql.Datevalue, using the givenCalendarobject.voidSets the designated parameter to anoracle.sql.DATEvalue.voidSets the designated parameter to the given Javadoublevalue.voidsetFixedCHAR(String parameterName, String x) Sets the designated parameter to aStringSee the javadoc for the setFixedChar(int, String) method in OraclePreparedStatement.voidSets the designated parameter to the given Javafloatvalue.voidSets the designated parameter to the given Javaintvalue.voidsetINTERVALDS(String parameterName, INTERVALDS x) Sets the designated parameter to anoracle.sql.INTERVALDSvalue.voidsetINTERVALYM(String parameterName, INTERVALYM x) Sets the designated parameter to anoracle.sql.INTERVALYMvalue.voidSets the designated parameter to the given Javalongvalue.voidSets the designated parameter to SQLNULL.voidSets the designated parameter to SQLNULL.voidSets the designated parameter to anoracle.sql.NUMBERvalue.voidSets the value of the designated parameter with the given object.voidSets the value of the designated parameter with the given object.voidSets the value of the designated parameter with the given object.voidSets the designated parameter to anoracle.sql.OPAQUEvalue.voidsetOracleObject(String parameterName, Datum x) Sets the designated parameter to anoracle.sql.Datumvalue.voidsetORAData(String parameterName, ORAData x) Sets the designated parameter to anoracle.sql.ORADatavalue.voidSets the designated parameter to anoracle.sql.RAWvalue.voidSets the designated parameter to anjdbc.sql.Refvalue.voidSets the designated parameter to anoracle.sql.REFvalue.voidsetRefType(String parameterName, REF x) Sets the designated parameter to anoracle.sql.REFvalue.voidSets the designated parameter to anoracle.sql.ROWIDvalue.voidSets the designated parameter to the given Javashortvalue.voidSets the designated parameter to the given JavaStringvalue.voidsetStringForClob(String parameterName, String x) Sets the designated parameter to the given JavaStringvalue.voidSets the designated parameter to anoracle.sql.STRUCTvalue.voidsetStructDescriptor(String parameterName, StructDescriptor x) voidSets the designated parameter to the givenjava.sql.Timevalue.voidSets the designated parameter to the givenjava.sql.Timevalue, using the givenCalendarobject.voidsetTimestamp(String parameterName, Timestamp x) Sets the designated parameter to the givenjava.sql.Timestampvalue.voidsetTimestamp(String parameterName, Timestamp x, Calendar cal) Sets the designated parameter to the givenjava.sql.Timestampvalue, using the givenCalendarobject.voidsetTIMESTAMP(String parameterName, TIMESTAMP x) Sets the designated parameter to anoracle.sql.TIMESTAMPvalue.voidsetTIMESTAMPLTZ(String parameterName, TIMESTAMPLTZ x) Sets the designated parameter to anoracle.sql.TIMESTAMPLTZvalue.voidsetTIMESTAMPTZ(String parameterName, TIMESTAMPTZ x) Sets the designated parameter to anoracle.sql.TIMESTAMPTZvalue.voidsetUnicodeStream(String parameterName, InputStream x, int y) Sets the designated parameter to a Java UnicodeStream value.voidSets the designated parameter to the givenjava.net.URLobject.Methods inherited from interface java.sql.CallableStatement
getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setCharacterStream, setCharacterStream, setClob, setClob, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setObject, setObject, setRowId, setSQLXML, wasNullMethods inherited from interface oracle.jdbc.OracleCommonPreparedStatement
executeAsyncOracle, executeBatchAsyncOracle, executeUpdateAsyncOracleMethods inherited from interface oracle.jdbc.OracleCommonStatement
continueOnErrorMethods inherited from interface oracle.jdbc.OraclePreparedStatement
defineParameterType, defineParameterTypeBytes, defineParameterTypeChars, executeQueryAsyncOracle, executeUpdateAndSuspend, getExecuteBatch, getReturnResultSet, OracleGetParameterMetaData, registerReturnParameter, registerReturnParameter, registerReturnParameter, sendBatch, setARRAY, setArrayAtName, setARRAYAtName, setAsciiStreamAtName, setAsciiStreamAtName, setAsciiStreamAtName, setBfile, setBFILE, setBfileAtName, setBFILEAtName, setBigDecimalAtName, setBinaryDouble, setBinaryDouble, setBinaryDoubleAtName, setBinaryDoubleAtName, setBinaryFloat, setBinaryFloat, setBinaryFloatAtName, setBinaryFloatAtName, setBinaryStreamAtName, setBinaryStreamAtName, setBinaryStreamAtName, setBLOB, setBlobAtName, setBlobAtName, setBlobAtName, setBLOBAtName, setBooleanAtName, setByteAtName, setBytesAtName, setBytesForBlob, setBytesForBlobAtName, setCHAR, setCharacterStreamAtName, setCharacterStreamAtName, setCHARAtName, setCheckBindTypes, setCLOB, setClobAtName, setClobAtName, setClobAtName, setCLOBAtName, setCursor, setCursorAtName, setCustomDatum, setCustomDatumAtName, setDATE, setDateAtName, setDateAtName, setDATEAtName, setDisableStmtCaching, setDoubleAtName, setExecuteBatch, setFixedCHAR, setFixedCHARAtName, setFloatAtName, setFormOfUse, setIntAtName, setINTERVALDS, setINTERVALDSAtName, setINTERVALYM, setINTERVALYMAtName, setLongAtName, setNCharacterStreamAtName, setNCharacterStreamAtName, setNClobAtName, setNClobAtName, setNClobAtName, setNStringAtName, setNullAtName, setNullAtName, setNUMBER, setNUMBERAtName, setObjectAtName, setObjectAtName, setObjectAtName, setOPAQUE, setOPAQUEAtName, setOracleObject, setOracleObjectAtName, setORAData, setORADataAtName, setPlsqlIndexTable, setRAW, setRAWAtName, setREF, setRefAtName, setREFAtName, setRefType, setRefTypeAtName, setROWID, setRowIdAtName, setROWIDAtName, setShortAtName, setSQLXMLAtName, setStringAtName, setStringForClob, setStringForClobAtName, setSTRUCT, setSTRUCTAtName, setStructDescriptor, setStructDescriptorAtName, setTimeAtName, setTimeAtName, setTIMESTAMP, setTimestampAtName, setTimestampAtName, setTIMESTAMPAtName, setTIMESTAMPLTZ, setTIMESTAMPLTZAtName, setTIMESTAMPTZ, setTIMESTAMPTZAtName, setUnicodeStreamAtName, setURLAtNameMethods inherited from interface oracle.jdbc.OracleStatement
clearDefines, closeOnCompletion, closeWithKey, creationState, defineColumnType, defineColumnType, defineColumnType, defineColumnType, defineColumnTypeBytes, defineColumnTypeChars, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, getLobPrefetchSize, getRegisteredQueryId, getRegisteredTableNames, getRowPrefetch, getSqlId, isNCHAR, isSimpleIdentifier, setDatabaseChangeRegistration, setEscapeProcessing, setLobPrefetchSize, setRowPrefetchMethods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, execute, executeLargeUpdate, 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, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURLMethods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeoutMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Method Details
-
getARRAY
Retrieves data into anoracle.sql.ARRAYobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
ARRAY - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getAsciiStream
Retrieves data into anjava.io.InputStreamobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
java.io.InputStream - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getBFILE
Retrieves data into anoracle.sql.BFILEobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.BFILE - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getBfile
Retrieves data into anoracle.sql.BFILEobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.BFILE - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getBinaryStream
Retrieves data into anjava.io.InputStreamobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
java.io.InputStream - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getBinaryStream
Retrieves data into anjava.io.InputStreamobject.- Parameters:
parameterName- the name of the stored procedure formal parameter- Returns:
- data into an
java.io.InputStream - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getBLOB
Retrieves data into anoracle.sql.BLOBobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.BLOB - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getCHAR
Retrieves data into anoracle.sql.CHARobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.CHAR - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getCharacterStream
Retrieves data into anjava.io.Readerobject.- Specified by:
getCharacterStreamin interfaceCallableStatement- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
java.io.Reader - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getCLOB
Retrieves data into anoracle.sql.CLOBobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.CLOB - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getCursor
Retrieves data into anjava.sql.ResultSetobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
java.sql.ResultSet - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getCustomDatum
Deprecated.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so onfactory-- Returns:
- Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getORAData
- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so onfactory-- Returns:
- Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getObject
Returns an instance ofOracleData, which is returned by the factory's "create" method- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so onfactory-- Returns:
- Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getAnyDataEmbeddedObject
Deprecated.As of Oracle 11R1 there is full support for ANYTYPE and ANYDATA. Please use oracle.sql.ANYDATA for new code and plan on replacing any use of this method by the next major release. Note that in 11R1 this method is reimplemented using the ANYDATA support and will now also function in all the drivers, not just oci. In the previous implementation it was possible to call registerOutParameter with a sqlType of either oracle.jdbc.OracleTypes.OPAQUE or oracle.jdbc.OracleTypes.STRUCT The new implementation requires the correct type which is OPAQUE.Retrieves data of an embedded object within AnyData- Parameters:
parameterIndex- the first parameter is 1- Returns:
- data depending on the embedded type in AnyData
- Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getDATE
Retrieves data into anoracle.sql.DATEobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.DATE - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getNUMBER
Retrieves data into anoracle.sql.NUMBERobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.NUMBER - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getOPAQUE
Retrieves data into anoracle.sql.OPAQUEobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.OPAQUE - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getOracleObject
Retrieves data into anoracle.sql.Datumobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.Datum - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getRAW
Retrieves data into anoracle.sql.RAWobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.RAW - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getREF
Retrieves data into anoracle.sql.REFobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.REF - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getROWID
Retrieves data into anoracle.sql.ROWIDobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.ROWID - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getSTRUCT
Retrieves data into anoracle.sql.STRUCTobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.STRUCT - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getINTERVALYM
Retrieves data into anoracle.sql.INTERVALYMobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.INTERVALYM - Throws:
SQLException- if an error occurs (conversion or database-access error)- Since:
- 9i
-
getINTERVALDS
Retrieves data into anoracle.sql.INTERVALDSobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.INTERVALDS - Throws:
SQLException- if an error occurs (conversion or database-access error)- Since:
- 10i
-
getTIMESTAMP
Retrieves data into anoracle.sql.TIMESTAMPobject.- Parameters:
paramIdx- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.TIMESTAMP - Throws:
SQLException- if an error occurs (conversion or database-access error)- Since:
- 9i
-
getTIMESTAMPTZ
Retrieves data into anoracle.sql.TIMESTAMPTZobject.- Parameters:
paramIdx- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.TIMESTAMPTZ - Throws:
SQLException- if an error occurs (conversion or database-access error)- Since:
- 9i
-
getTIMESTAMPLTZ
Retrieves data into anoracle.sql.TIMESTAMPLTZobject.- Parameters:
paramIdx- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
oracle.sql.TIMESTAMPLTZ - Throws:
SQLException- if an error occurs (conversion or database-access error)- Since:
- 9i
-
getUnicodeStream
Retrieves data into anjava.io.InputStreamobject.- Parameters:
parameterIndex- the first parameter is 1, the second is 2, and so on- Returns:
- data into an
java.io.InputStream - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getUnicodeStream
Retrieves data into anjava.io.InputStreamobject.- Parameters:
parameterName- the name of the stored procedure formal parameter- Returns:
- data into an
java.io.InputStream - Throws:
SQLException- if an error occurs (conversion or database-access error)
-
registerOutParameter
void registerOutParameter(int paramIndex, int sqlType, int scale, int maxLength) throws SQLException Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. Depending on the value of OracleConnection.getDataSizeUnits(), maxLength will be measured in bytes or characters.- Parameters:
paramIndex- parameter index (the first parameter is 1).sqlType- type of the bind parameterscale- not usedmaxLength- maximum length of the column, specified in bytes or characters.- Throws:
SQLException- if an error occurs (conversion or database-access error)
-
registerOutParameterBytes
void registerOutParameterBytes(int paramIndex, int sqlType, int scale, int maxLength) throws SQLException Deprecated.As of Oracle 10g Release 1 all character values are measured in Java chars so this method is no longer supported. It now is the equivalent of calling registerOutParameter with the same args. Since the number of bytes is at least as large as the number of characters this will always work although it may waste memory. Use registerOutParameter with the number of Java chars instead.Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. This version accepts a maxLength parameter measured in bytes.- Parameters:
paramIndex- parameter index (the first parameter is 1).sqlType- type of the bind parameterscale- not usedmaxLength- maximum length of the column, specified in bytes. If not specified, maximum length allowed for that type is used.- Throws:
SQLException- if an error occurs (conversion or database-access error)
-
registerOutParameterChars
void registerOutParameterChars(int paramIndex, int sqlType, int scale, int maxLength) throws SQLException Deprecated.As of Oracle 10g Release 1 all character values are measured in Java chars so this method is no longer needed. Call registerOutParameter with the same args instead.Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. This version accepts a maxLength parameter measured in characters.- Parameters:
paramIndex- parameter index (the first parameter is 1).sqlType- type of the bind parameterscale- not usedmaxLength- maximum length of the column, specified in characters. If not specified, maximum length allowed for that type is used.- Throws:
SQLException- if an error occurs (conversion or database-access error)
-
getPlsqlIndexTable
Deprecated.since 18.1. Use java.sql.CallableStatement.getObject(int parameterIndex) method.Get the value of a PLSQL Associative Array ( formerly known as index-by-table ) parameter as a Java array. The type of the Java array will be the default Java object type corresponding to the element's SQL type, following the mapping for built-in types specified in the JDBC spec.- Parameters:
paramIndex- the first parameter is 1, the second is 2, and so on- Returns:
- A java.lang.Object holding the parameter value.
- Throws:
SQLException- if a database-access error occurs.SQLException- if an error occurs (conversion or database-access error)- See Also:
-
getPlsqlIndexTable
Deprecated.since 18.1. Use java.sql.CallableStatement.getObject(int parameterIndex, Classtype) method. Get the value of a PLSQL Associative Array ( formerly known as index-by-table ) parameter as a primitive array. 'primitiveType' specifies the return array type.- Parameters:
paramIndex- the first parameter is 1, the second is 2, and so onprimitiveType- is a primitive type class. For example,java.lang.Double.Type- Returns:
- A java.lang.Object holding the parameter value.
- Throws:
SQLException- if a database-access error occurs.SQLException- if an error occurs (conversion or database-access error)- See Also:
-
getOraclePlsqlIndexTable
Deprecated.since 18.1 Use java.sql.CallableStatement.getObject(int parameterIndex) method.Get the value of a PLSQL Associative Array ( formerly known as index-by-table ) parameter as an oracle.sql.Datum array.- Parameters:
paramIndex- the first parameter is 1, the second is 2, and so on- Returns:
- A Datum array holding the parameter value.
- Throws:
SQLException- if a database-access error occurs.SQLException- if an error occurs (conversion or database-access error)- See Also:
-
registerIndexTableOutParameter
@Deprecated void registerIndexTableOutParameter(int paramIndex, int maxLen, int elemSqlType, int elemMaxLen) throws SQLException Deprecated.since 18.1. Use java.sql.CallableStatement.registerOutParameter (int parameterIndex, int sqlType, String typeName).Special Oracle version of registerOutParameter for registering a limited form of PL/SQL Associative Array parameters. Associative Arrays were formerly called index-by-tables. In PL/SQL they are arrays of key-value pairs where the keys may be numeric or string types and the values may be any scalar type. The keys may be sparse. See the PL/SQL manual. The database only exports a limited form of this to the client where the keys must be numeric, positive and dense and the values can be only numeric or string. This API is supported by the oci and thin driver It is also supported by the server side internal driver with a limitation on the element length for string of 1999 characters. For oci and thin this is the same as the database limitation of 32767 characters.- Parameters:
paramIndex- the first parameter is 1, the second is 2, and so onmaxLen- the maximum possible number of elements.elemSqlType- index table element SQL type (as defined in java.sql.Types or OracleTypes).elemMaxLen- maximum length of the element. If not specified, maximum length allowed for that type is used.- Throws:
SQLException- if sqlType is invalid, or an error occurred.- Since:
- 8.1.7
-
setBinaryFloat
Sets the designated parameter to the givenoracle.sql.BINARY_FLOATvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 10.0
- See Also:
-
setBinaryDouble
Sets the designated parameter to the givenoracle.sql.BINARY_FLOATvalue.- Parameters:
parameterName- name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 10.0
- See Also:
-
setStringForClob
Sets the designated parameter to the given JavaStringvalue. The driver converts this to an SQLVARCHARorLONGVARCHARvalue (depending on the argument's size relative to the driver's limits onVARCHARvalues) when it sends it to the database. If the string is larger than 32765 it is converted to a temporary clob and that is sent to the database. This clob conversion produces data truncation for columns of typeVARCHARandLONGVARCHAR. This is wrong.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 10i Release 1
- See Also:
-
setBytesForBlob
Sets the designated parameter to the given Javabyte[]value. The driver converts this to an SQLBINARYorLONGBINARY CHECK THISvalue (depending on the argument's size relative to the driver's limits onVARCHARvalues) when it sends it to the database. If the byte array is larger than 32765 it is converted to a temporary blob and that is sent to the database. This blob conversion produces data truncation for columns of typeBINARY..- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 10i Release 1
- See Also:
-
registerOutParameter
void registerOutParameter(String parameterName, int sqlType, int scale, int maxLength) throws SQLException Special Oracle version of registerOutParameter for registering CHAR, VARCHAR, LONG, RAW and LONG RAW columns. Depending on the value of OracleConnection.getDataSizeUnits(), maxLength will be measured in bytes or characters.- Parameters:
parameterName- the name of the parametersqlType- SQL type code defined byjava.sql.Types.scale- the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.maxLength- maximum length of the column, specified in bytes or characters.- Throws:
SQLException- if an error occurs (conversion or database-access error)- Since:
- 10i Release 1
-
setNull
Sets the designated parameter to SQLNULL. This version of the methodsetNullshould be used for user-defined types and REF type parameters. Examples of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.Note: To be portable, applications must give the SQL type code and the fully-qualified SQL type name when specifying a NULL user-defined or REF parameter. In the case of a user-defined type the name is the type name of the parameter itself. For a REF parameter, the name is the type name of the referenced type. If a JDBC driver does not need the type code or type name information, it may ignore it. Although it is intended for user-defined and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-defined or REF type, the given typeName is ignored.
- Specified by:
setNullin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parametersqlType- a value fromjava.sql.TypestypeName- the fully-qualified name of an SQL user-defined type; ignored if the parameter is not a user-defined type or SQLREFvalue- Throws:
SQLException- if a database access error occurs- Since:
- 10i Release 1
-
setNull
Sets the designated parameter to SQLNULL.Note: You must specify the parameter's SQL type.
- Specified by:
setNullin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parametersqlType- the SQL type code defined injava.sql.Types- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
-
setBoolean
Sets the designated parameter to the given Javabooleanvalue. The driver converts this to an SQLBITvalue when it sends it to the database.- Specified by:
setBooleanin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setByte
Sets the designated parameter to the given Javabytevalue. The driver converts this to an SQLTINYINTvalue when it sends it to the database.- Specified by:
setBytein interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setShort
Sets the designated parameter to the given Javashortvalue. The driver converts this to an SQLSMALLINTvalue when it sends it to the database.- Specified by:
setShortin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setInt
Sets the designated parameter to the given Javaintvalue. The driver converts this to an SQLINTEGERvalue when it sends it to the database.- Specified by:
setIntin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setLong
Sets the designated parameter to the given Javalongvalue. The driver converts this to an SQLBIGINTvalue when it sends it to the database.- Specified by:
setLongin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setFloat
Sets the designated parameter to the given Javafloatvalue. The driver converts this to an SQLFLOATvalue when it sends it to the database.- Specified by:
setFloatin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setBinaryFloat
Sets the designated parameter to the given Javafloatvalue. The driver converts this to an SQLBINARY_FLOATvalue when it sends it to the database.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 10.0
- See Also:
-
setBinaryDouble
Sets the designated parameter to the givenoracle.sql.BINARY_FLOATvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 10.0
- See Also:
-
setDouble
Sets the designated parameter to the given Javadoublevalue. The driver converts this to an SQLDOUBLEvalue when it sends it to the database.- Specified by:
setDoublein interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setBigDecimal
Sets the designated parameter to the givenjava.math.BigDecimalvalue. The driver converts this to an SQLNUMERICvalue when it sends it to the database.- Specified by:
setBigDecimalin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setString
Sets the designated parameter to the given JavaStringvalue. The driver converts this to an SQLVARCHARorLONGVARCHARvalue (depending on the argument's size relative to the driver's limits onVARCHARvalues) when it sends it to the database.- Specified by:
setStringin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setFixedCHAR
Sets the designated parameter to aStringSee the javadoc for the setFixedChar(int, String) method in OraclePreparedStatement. Note that PL/SQL comparison operators do provide blank padding.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setCursor
Sets the designated parameter to a Java Cursor value.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setROWID
Sets the designated parameter to anoracle.sql.ROWIDvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setRAW
Sets the designated parameter to anoracle.sql.RAWvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setCHAR
Sets the designated parameter to anoracle.sql.CHARvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setDATE
Sets the designated parameter to anoracle.sql.DATEvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setNUMBER
Sets the designated parameter to anoracle.sql.NUMBERvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setBLOB
Sets the designated parameter to anoracle.sql.BLOBvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setBlob
Sets the designated parameter to anjava.sql.Blobvalue.- Specified by:
setBlobin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setCLOB
Sets the designated parameter to anoracle.sql.CLOBvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setClob
Sets the designated parameter to anjava.sql.Clobvalue.- Specified by:
setClobin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setBFILE
Sets the designated parameter to anoracle.sql.BFILEvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setBfile
Sets the designated parameter to anoracle.sql.BFILEvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setBytes
Sets the designated parameter to the given Java array of bytes. The driver converts this to an SQLVARBINARYorLONGVARBINARY(depending on the argument's size relative to the driver's limits onVARBINARYvalues) when it sends it to the database.- Specified by:
setBytesin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setDate
Sets the designated parameter to the givenjava.sql.Datevalue. The driver converts this to an SQLDATEvalue when it sends it to the database.- Specified by:
setDatein interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setTime
Sets the designated parameter to the givenjava.sql.Timevalue. The driver converts this to an SQLTIMEvalue when it sends it to the database.- Specified by:
setTimein interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setTimestamp
Sets the designated parameter to the givenjava.sql.Timestampvalue. The driver converts this to an SQLTIMESTAMPvalue when it sends it to the database.- Specified by:
setTimestampin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setINTERVALYM
Sets the designated parameter to anoracle.sql.INTERVALYMvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setINTERVALDS
Sets the designated parameter to anoracle.sql.INTERVALDSvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setTIMESTAMP
Sets the designated parameter to anoracle.sql.TIMESTAMPvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setTIMESTAMPTZ
Sets the designated parameter to anoracle.sql.TIMESTAMPTZvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setTIMESTAMPLTZ
Sets the designated parameter to anoracle.sql.TIMESTAMPLTZvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setAsciiStream
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large ASCII value is input to aLONGVARCHARparameter, it may be more practical to send it via ajava.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.
- Specified by:
setAsciiStreamin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the Java input stream that contains the ASCII parameter valuey- the number of bytes in the stream- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
-
setBinaryStream
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large binary value is input to aLONGVARBINARYparameter, it may be more practical to send it via ajava.io.InputStreamobject. 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.
- Specified by:
setBinaryStreamin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the java input stream which contains the binary parameter valuey- the number of bytes in the stream- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
-
setUnicodeStream
Sets the designated parameter to a Java UnicodeStream value.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the java input stream which contains the binary parameter valuey- the number of bytes in the stream- Throws:
SQLException- if a database access error occurs
-
setCharacterStream
Sets the designated parameter to the givenReaderobject, which is the given number of characters long. When a very large UNICODE value is input to aLONGVARCHARparameter, it may be more practical to send it via ajava.io.Readerobject. 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.
- Specified by:
setCharacterStreamin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- thejava.io.Readerobject that contains the UNICODE data used as the designated parametery- the number of characters in the stream- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
-
setDate
Sets the designated parameter to the givenjava.sql.Datevalue, using the givenCalendarobject. The driver uses theCalendarobject to construct an SQLDATEvalue, which the driver then sends to the database. With a aCalendarobject, the driver can calculate the date taking into account a custom time zone. If noCalendarobject is specified, the driver uses the default time zone, which is that of the virtual machine running the application.- Specified by:
setDatein interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter valuecal- theCalendarobject the driver will use to construct the date- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setTime
Sets the designated parameter to the givenjava.sql.Timevalue, using the givenCalendarobject. The driver uses theCalendarobject to construct an SQLTIMEvalue, which the driver then sends to the database. With a aCalendarobject, the driver can calculate the time taking into account a custom time zone. If noCalendarobject is specified, the driver uses the default time zone, which is that of the virtual machine running the application.- Specified by:
setTimein interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter valuecal- theCalendarobject the driver will use to construct the time- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setTimestamp
Sets the designated parameter to the givenjava.sql.Timestampvalue, using the givenCalendarobject. The driver uses theCalendarobject to construct an SQLTIMESTAMPvalue, which the driver then sends to the database. With a aCalendarobject, the driver can calculate the timestamp taking into account a custom time zone. If noCalendarobject is specified, the driver uses the default time zone, which is that of the virtual machine running the application.- Specified by:
setTimestampin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter valuecal- theCalendarobject the driver will use to construct the timestamp- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setURL
Sets the designated parameter to the givenjava.net.URLobject. The driver converts this to an SQLDATALINKvalue when it sends it to the database.- Specified by:
setURLin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs, or if a URL is malformed- Since:
- 9.0.2
- See Also:
-
setArray
Sets the designated parameter to anjava.sql.Arrayvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setARRAY
Sets the designated parameter to anoracle.sql.ARRAYvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setOPAQUE
Sets the designated parameter to anoracle.sql.OPAQUEvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setStructDescriptor
- Throws:
SQLException
-
setSTRUCT
Sets the designated parameter to anoracle.sql.STRUCTvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setCustomDatum
Sets the designated parameter to anoracle.sql.CustomDatumvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setORAData
Sets the designated parameter to anoracle.sql.ORADatavalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setObject
Sets the value of the designated parameter with the given object. The second argument must be an object type; for integral values, thejava.langequivalent objects should be used.The given Java object will be converted to the given targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing the interface
SQLData), the JDBC driver should call the methodSQLData.writeSQLto write it to the SQL data stream. If, on the other hand, the object is of a class implementingRef,Blob,Clob,Struct, orArray, the driver should pass it to the database as a value of the corresponding SQL type.Note that this method may be used to pass database- specific abstract data types.
- Specified by:
setObjectin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the object containing the input parameter valuetargetSqlType- the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.scale- for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, this is the number of digits after the decimal point. For all other types, this value will be ignored.- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setObject
Sets the value of the designated parameter with the given object. This method is like the methodsetObjectabove, except that it assumes a scale of zero.- Specified by:
setObjectin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the object containing the input parameter valuey- the SQL type (as defined in java.sql.Types) to be sent to the database- Throws:
SQLException- if a database access error occurs- Since:
- 9.0.2
- See Also:
-
setRefType
Sets the designated parameter to anoracle.sql.REFvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setRef
Sets the designated parameter to anjdbc.sql.Refvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setREF
Sets the designated parameter to anoracle.sql.REFvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
setObject
Sets the value of the designated parameter with the given object. The second parameter must be of typeObject; therefore, thejava.langequivalent objects should be used for built-in types.The JDBC specification specifies a standard mapping from Java
Objecttypes to SQL types. The given argument will be converted to the corresponding SQL type before being sent to the database.Note that this method may be used to pass database- specific abstract data types, by using a driver-specific Java type. If the object is of a class implementing the interface
SQLData, the JDBC driver should call the methodSQLData.writeSQLto write it to the SQL data stream. If, on the other hand, the object is of a class implementingRef,Blob,Clob,Struct, orArray, the driver should pass it to the database as a value of the corresponding SQL type.This method throws an exception if there is an ambiguity, for example, if the object is of a class implementing more than one of the interfaces named above.
- Specified by:
setObjectin interfaceCallableStatement- Parameters:
parameterName- the name of the stored procedure formal parameterx- the object containing the input parameter value- Throws:
SQLException- if a database access error occurs or if the givenObjectparameter is ambiguous- Since:
- 9.0.2
- See Also:
-
setOracleObject
Sets the designated parameter to anoracle.sql.Datumvalue.- Parameters:
parameterName- the name of the stored procedure formal parameterx- the parameter value- Throws:
SQLException- if a database access error occurs
-
registerOutParameterAtName
Special Oracle method to registerOutParameter by the parameterMarkerName of oracle style parameter markers instead of parameterIndex. Please note that it takes the name of the parameter marker and not the name of the parameter.- Parameters:
parameterMarkerName- The name of the oracle style parameter markersqlType- a value fromTypes- Throws:
SQLException
-
registerOutParameterAtName
void registerOutParameterAtName(String parameterMarkerName, int sqlType, int scale) throws SQLException Special Oracle method to registerOutParameter by the parameterMarkerName of oracle style parameter markers instead of parameterIndex. Please note that it takes the name of the parameter marker and not the name of the parameter.- Parameters:
parameterMarkerName- The name of the oracle style parameter markersqlType- a value fromTypesscale- the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.- Throws:
SQLException
-
registerOutParameterAtName
void registerOutParameterAtName(String parameterMarkerName, int sqlType, String typeName) throws SQLException Special Oracle method to registerOutParameter by the parameterMarkerName of oracle style parameter markers instead of parameterIndex. Please note that it takes the name of the parameter marker and not the name of the parameter.- Parameters:
parameterMarkerName- The name of the oracle style parameter markersqlType- a value fromTypestypeName- the fully-qualified name of an SQL structured type- Throws:
SQLException
-