PreparedStatement Is an OraclePreparedStatement
The
PreparedStatement
object is an interface,
java.sql.PreparedStatement
, implemented by the
oracle.jdbc.driver.OraclePreparedStatement
class
that extends oracle.jdbc.driver.OracleStatement
.
This means that all of the proprietary methods available in
OracleStatement
are also available in
OraclePreparedStatement
. The following are the
proprietary methods for an
OraclePreparedStatement
, all of which can throw a
SQLException
:
defineParameterType(int param_index, int type, int max_size) int getExecuteBatch( ) int sendBatch( ) setARRAY(int paramIndex, ARRAY arr) setBFILE(int paramIndex, BFILE file) setBfile(int paramIndex, BFILE file) setBLOB(int paramIndex, BLOB lob) setCHAR(int paramIndex, CHAR ch) setCLOB(int paramIndex, CLOB lob) setCursor(int paramIndex, ResultSet rs) setCustomDatum(int paramIndex, CustomDatum x) setDATE(int paramIndex, DATE date) setExecuteBatch(int batchValue) setFixedCHAR(int paramIndex, String x) setNUMBER(int paramIndex, NUMBER num) setOracleObject(int paramIndex, Datum x) setRAW(int paramIndex, RAW raw) setREF(int paramIndex, REF ref) setRefType(int paramIndex, REF ref) setROWID(int paramIndex, ROWID rowid) setSTRUCT(int paramIndex, STRUCT struct)
Now that you have an understanding of how to use a
PreparedStatement
, we can move on to the next
chapter on streaming data
types.
Get Java Programming with Oracle JDBC now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.