JDBC for Oracle - Herong's Tutorial Examples
∟Oracle - PreparedStatement
This chapter provides tutorial notes on JDBC PreparedStatement with Oracle JDBC Driver. Topics include creating PreparedStatement objects; setting PreparedStatement parameters; running PreparedStatement in batch mode; comparing PreparedStatement performance.
PreparedStatement Overview
PreparedStatement with Parameters
PreparedStatement in Batch Mode
Performance of Inserting Rows with a PreparedStatement
Performance of Inserting Rows with a Regular Statement
Performance of Inserting Rows with a ResultSet
Takeaways:
- SQL statements in PreparedStatement objects are pre-compiled on the database server side.
- IN parameters are supported in SQL statements in PreparedStatement objects.
- setXXX() methods can be used to provide values to parameters in PreparedStatement objects.
- Batch execution mode is supported to run the run SQL statement multiple times in a single transaction.
- For multiple repeating insert operations, PreparedStatement performs better than regular
INSERT statement.
Table of Contents
About This Book
JDBC (Java Database Connectivity) Introduction
JDK (Java SE) Installation
Oracle Express Edition Installation on Windows
Oracle JDBC Drivers
Oracle - Reference Implementation of JdbcRowSet
►Oracle - PreparedStatement
Oracle - JBDC CallableStatement
Oracle CLOB (Character Large Object) - TEXT
Oracle BLOB (Binary Large Object) - BLOB
Archived Tutorials
References
Full Version in PDF/EPUB