📄 oracle.jdbc.driver.oraclepreparedstatement.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><!--NewPage--><html><head><!-- Generated by javadoc on Thu Dec 02 03:30:11 PST 1999 --><title> Class oracle.jdbc.driver.OraclePreparedStatement</title></head><body><a name="_top_"></a><pre><a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-oracle.jdbc.driver.html">This Package</a> <a href="oracle.jdbc.driver.OracleLog.html#_top_">Previous</a> <a href="oracle.jdbc.driver.OracleResultSet.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre><hr><h1> Class oracle.jdbc.driver.OraclePreparedStatement</h1><pre>java.lang.Object | +----<a href="oracle.jdbc.driver.OracleStatement.html#_top_">oracle.jdbc.driver.OracleStatement</a> | +----oracle.jdbc.driver.OraclePreparedStatement</pre><hr><dl> <dt> public class <b>OraclePreparedStatement</b> <dt> extends <a href="oracle.jdbc.driver.OracleStatement.html#_top_">OracleStatement</a> <dt> implements PreparedStatement</dl>Oracle prepared statement class.<p><hr><a name="index"></a><h2> <img src="images/method-index.gif" width=207 height=38 alt="Method Index"></h2><dl> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#addBatch()"><b>addBatch</b></a>() <dd> Add a set of parameters to the batch. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#addBatch(java.lang.String)"><b>addBatch</b></a>(String) <dd> This method cannot be used in OraclePreparedStatement. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#clearBatch()"><b>clearBatch</b></a>() <dd> Make the set of parameters in the current batch empty. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#clearParameters()"><b>clearParameters</b></a>() <dd> <P>In general, parameter values remain in force for repeated use of aStatement. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#close()"><b>close</b></a>() <dd> Close the prepared statement. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#defineParameterType(int, int, int)"><b>defineParameterType</b></a>(int, int, int) <dd> Define the type under which you will bind the parameter and the maximum size of data you will bind in binds. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#execute()"><b>execute</b></a>() <dd> Execute the statement. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#executeBatch()"><b>executeBatch</b></a>() <dd> Submit a batch of parameters to the database for execution. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#executeQuery()"><b>executeQuery</b></a>() <dd> Execute the query statement. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#executeUpdate()"><b>executeUpdate</b></a>() <dd> Execute the update statement. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getExecuteBatch()"><b>getExecuteBatch</b></a>() <dd> Retrieve the batch value (for Oracle-style batching only). <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getMetaData()"><b>getMetaData</b></a>() <dd> JDBC 2.0Gets the number, types and properties of a ResultSet's columns. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#sendBatch()"><b>sendBatch</b></a>() <dd> Send any existing Oracle-style batch. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setArray(int, oracle.jdbc2.Array)"><b>setArray</b></a>(int, Array) <dd> JDBC 2.0. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setARRAY(int, oracle.sql.ARRAY)"><b>setARRAY</b></a>(int, ARRAY) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setAsciiStream(int, java.io.InputStream, int)"><b>setAsciiStream</b></a>(int, InputStream, int) <dd> Sets the designated parameter to the given input stream, which will have the specified number of bytes. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setBFILE(int, oracle.sql.BFILE)"><b>setBFILE</b></a>(int, BFILE) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setBfile(int, oracle.sql.BFILE)"><b>setBfile</b></a>(int, BFILE) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setBigDecimal(int, java.math.BigDecimal)"><b>setBigDecimal</b></a>(int, BigDecimal) <dd> Sets the designated parameter to a java.lang.BigDecimal value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setBinaryStream(int, java.io.InputStream, int)"><b>setBinaryStream</b></a>(int, InputStream, int) <dd> Sets the designated parameter to the given input stream, which will have the specified number of bytes. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setBLOB(int, oracle.sql.BLOB)"><b>setBLOB</b></a>(int, BLOB) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setBlob(int, oracle.jdbc2.Blob)"><b>setBlob</b></a>(int, Blob) <dd> JDBC 2.0. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setBoolean(int, boolean)"><b>setBoolean</b></a>(int, boolean) <dd> Sets the designated parameter to a Java boolean value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setByte(int, byte)"><b>setByte</b></a>(int, byte) <dd> Sets the designated parameter to a Java byte value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setBytes(int, byte[])"><b>setBytes</b></a>(int, byte[]) <dd> Sets the designated parameter to a Java array of bytes. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setCHAR(int, oracle.sql.CHAR)"><b>setCHAR</b></a>(int, CHAR) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setCharacterStream(int, java.io.Reader, int)"><b>setCharacterStream</b></a>(int, Reader, int) <dd> JDBC 2.0Sets the designated parameter to the given <code>Reader</code>object, which is the given number of characters long. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setClob(int, oracle.jdbc2.Clob)"><b>setClob</b></a>(int, Clob) <dd> JDBC 2.0. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setCLOB(int, oracle.sql.CLOB)"><b>setCLOB</b></a>(int, CLOB) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setCursor(int, java.sql.ResultSet)"><b>setCursor</b></a>(int, ResultSet) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setCustomDatum(int, oracle.sql.CustomDatum)"><b>setCustomDatum</b></a>(int, CustomDatum) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDATE(int, oracle.jdbc.driver.DATE)"><b>setDATE</b></a>(int, DATE) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDate(int, java.sql.Date)"><b>setDate</b></a>(int, Date) <dd> Sets the designated parameter to a java.sql.Date value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDate(int, java.sql.Date, java.util.Calendar)"><b>setDate</b></a>(int, Date, Calendar) <dd> JDBC 2.0Sets the designated parameter to a java.sql.Date value,using the given <code>Calendar</code> object. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDouble(int, double)"><b>setDouble</b></a>(int, double) <dd> Sets the designated parameter to a Java double value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setExecuteBatch(int)"><b>setExecuteBatch</b></a>(int) <dd> Set the batch value (for Oracle-style batching only). <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setFixedCHAR(int, java.lang.String)"><b>setFixedCHAR</b></a>(int, String) <dd> Use this method when binding to a CHAR column in the where clause of a Select statement. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setFloat(int, float)"><b>setFloat</b></a>(int, float) <dd> Sets the designated parameter to a Java float value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setInt(int, int)"><b>setInt</b></a>(int, int) <dd> Sets the designated parameter to a Java int value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setLong(int, long)"><b>setLong</b></a>(int, long) <dd> Sets the designated parameter to a Java long value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setNull(int, int)"><b>setNull</b></a>(int, int) <dd> Sets the designated parameter to SQL NULL. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setNull(int, int, java.lang.String)"><b>setNull</b></a>(int, int, String) <dd> Implements JDBC 2.0 setNull for object types. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setNUMBER(int, oracle.jdbc.driver.NUMBER)"><b>setNUMBER</b></a>(int, NUMBER) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setObject(int, java.lang.Object)"><b>setObject</b></a>(int, Object) <dd> Sets the value of the designated parameter with the given object. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setObject(int, java.lang.Object, int)"><b>setObject</b></a>(int, Object, int) <dd> Sets the value of the designated parameter with the given object. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setObject(int, java.lang.Object, int, int)"><b>setObject</b></a>(int, Object, int, int) <dd> <p>Sets the value of a parameter using an object. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setOracleObject(int, oracle.jdbc.driver.Datum)"><b>setOracleObject</b></a>(int, Datum) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setRAW(int, oracle.sql.RAW)"><b>setRAW</b></a>(int, RAW) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setRef(int, oracle.jdbc2.Ref)"><b>setRef</b></a>(int, Ref) <dd> JDBC 2.0Sets a Ref(<structured-type>) parameter. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setREF(int, oracle.sql.REF)"><b>setREF</b></a>(int, REF) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setRefType(int, oracle.sql.REF)"><b>setRefType</b></a>(int, REF) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setROWID(int, oracle.sql.ROWID)"><b>setROWID</b></a>(int, ROWID) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setShort(int, short)"><b>setShort</b></a>(int, short) <dd> Sets the designated parameter to a Java short value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setString(int, java.lang.String)"><b>setString</b></a>(int, String) <dd> Sets the designated parameter to a Java String value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setSTRUCT(int, oracle.sql.STRUCT)"><b>setSTRUCT</b></a>(int, STRUCT) <dd> Oracle specific. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setTime(int, java.sql.Time)"><b>setTime</b></a>(int, Time) <dd> Sets the designated parameter to a java.sql.Time value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setTime(int, java.sql.Time, java.util.Calendar)"><b>setTime</b></a>(int, Time, Calendar) <dd> JDBC 2.0Sets the designated parameter to a java.sql.Time value,using the given <code>Calendar</code> object. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setTimestamp(int, java.sql.Timestamp)"><b>setTimestamp</b></a>(int, Timestamp) <dd> Sets the designated parameter to a java.sql.Timestamp value. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setTimestamp(int, java.sql.Timestamp, java.util.Calendar)"><b>setTimestamp</b></a>(int, Timestamp, Calendar) <dd> JDBC 2.0Sets the designated parameter to a java.sql.Timestamp value,using the given <code>Calendar</code> object. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setUnicodeStream(int, java.io.InputStream, int)"><b>setUnicodeStream</b></a>(int, InputStream, int) <dd> Sets the designated parameter to the given input stream, which will have the specified number of bytes.<b>Deprecated.</b></dl><a name="methods"></a><h2> <img src="images/methods.gif" width=151 height=38 alt="Methods"></h2><a name="close()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="close"><b>close</b></a><pre> public synchronized void close() throws SQLException</pre><dl> <dd> Close the prepared statement.<p> <dd><dl> <dt> <b>Throws:</b> SQLException <dd> if error(s) occurred. <dt> <b>Overrides:</b> <dd> <a href="oracle.jdbc.driver.OracleStatement.html#close()">close</a> in class <a href="oracle.jdbc.driver.OracleStatement.html#_top_">OracleStatement</a> </dl></dd></dl><a name="executeQuery()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="executeQuery"><b>executeQuery</b></a><pre> public synchronized ResultSet executeQuery() throws SQLException</pre><dl> <dd> Execute the query statement.<p> <dd><dl> <dt> <b>Returns:</b> <dd> the query result set. <dt> <b>Throws:</b> SQLException <dd> if error(s) occurred. </dl></dd></dl><a name="executeUpdate()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="executeUpdate"><b>executeUpdate</b></a><pre> public synchronized int executeUpdate() throws SQLException</pre><dl> <dd> Execute the update statement.<p> <dd><dl> <dt> <b>Throws:</b> SQLException <dd> if error(s) occurred. </dl></dd></dl><a name="execute()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="execute"><b>execute</b></a><pre> public synchronized boolean execute() throws SQLException</pre><dl> <dd> Execute the statement.<p> <dd><dl> <dt> <b>Throws:</b> SQLException <dd> if error(s) occurred. </dl></dd></dl><a name="sendBatch()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="sendBatch"><b>sendBatch</b></a><pre> public synchronized int sendBatch() throws SQLException</pre><dl> <dd> Send any existing Oracle-style batch.<p>This API is used in the context of Oracle-style batching. It flushesany batched executions before the batch value is reached. Executionsnormally happen when the number of executions reaches the batch value,which is set via the API <code>setExecuteBatch()</code>. It does notdo anything if the statement does not use Oracle-style batching.<p>To use this API, the user must cast the PreparedStatement object to<code>oracle.jdbc.driver.OraclePreparedStatement</code>.<p><p> <dd><dl> <dt> <b>Returns:</b> <dd> the update count. <dt> <b>Throws:</b> SQLException <dd> if an error occurred. <dt> <b>Overrides:</b> <dd> <a href="oracle.jdbc.driver.OracleStatement.html#sendBatch()">sendBatch</a> in class <a href="oracle.jdbc.driver.OracleStatement.html#_top_">OracleStatement</a> </dl></dd></dl><a name="setExecuteBatch(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setExecuteBatch"><b>setExecuteBatch</b></a><pre> public synchronized void setExecuteBatch(int batchValue) throws SQLException</pre><dl> <dd> Set the batch value (for Oracle-style batching only).<p>The Oracle Jdbc driver can "batch" multiple executions of a singlestatement with different bind variables. Actual execution happenswhen the number of batched executions reaches the "batch value",which is set by this API.<p>The batch value for this prepared statement can be set at any timevia this API. Changing the batch value will affect all futureexecutes.<p>The batch value will automatically be set to 1 by the driver ifany of the bind types is of type stream. This overrides any value
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -