MySQL - PreparedStatement

This chapter provides tutorial notes on JDBC PreparedStatement with MySQL JDBC Driver. Topics include creating PreparedStatement objects; setting PreparedStatement parameters; running PreparedStatement in batch mode; comparing PreparedStatement performance.

Tutorial programs in this chapter use DataSource objects retrieved from a JNDI directory service to create connections. Read previous chapters to learn how store DataSource objects into a JNDI directory service.

PreparedStatement Overview

PreparedStatement with Parameters

PreparedStatement in Batch Mode

Performance of Inserting Rows with a PreparedStatement

InnoDB (MySQL 5.5 Default Engine) Slower on INSERT

Performance of Inserting Rows with a Regular Statement

Performance of Inserting Rows with a ResultSet

Takeaways:

Table of Contents

 About This Book

 JDBC (Java Database Connectivity) Introduction

 JDK (Java SE) Installation

 MySQL Installation on Windows

 MySQL JDBC Driver (MySQL Connector/J)

MySQL - PreparedStatement

 MySQL - Reference Implementation of JdbcRowSet

 MySQL - JBDC CallableStatement

 MySQL CLOB (Character Large Object) - TEXT

 MySQL BLOB (Binary Large Object) - BLOB

 Using Connection Pool with JDBC

 Archived Tutorials

 References

 Full Version in PDF/EPUB