JDBC Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 2.11

Performances on Inserting Rows

This section provides a simple comparison of performances on inserting rows with different JDBC drivers and their database servers.

While testing different ways of inserting rows into database tables, I have also collected their performances of inserting 10000 rows on my Windows XP system with a 997MHz processor. A summary of various performance results using different inserting statements with different JDBC drivers is provided here as a comparison and a reference:

Driver Name: Apache Derby Network Client JDBC Driver
------------
Driver JAR File: derbyclient.jar
Statement           # of inserts   Time in ms.   Comparison
Regular Statement   10000          47531         598%
PreparedStatement   10000           7953         100%
ResultSet           10000           5906          74%

Driver Name: MySQL Connctor/J 
------------
Driver JAR File: mysql-connector-java-5.0.7-bin.jar
Statement           # of inserts   Time in ms.   Comparison
Regular Statement   10000           1297         101%
PreparedStatement   10000           1281         100%
ResultSet           10000           3062         239%

Driver Name: Oracle JDBC Thin client-side driver
------------
Driver JAR File: ojdbc14.jar
Statement           # of inserts   Time in ms.   Comparison
Regular Statement   10000          13609         174%
PreparedStatement   10000           7843         100%
ResultSet  ?

Driver Name: Miscrosoft JDBC Driver
------------
Driver JAR File: sqljdbc.jar
Statement           # of inserts   Time in ms.   Comparison
PreparedStatement   10000           5625         100%
Regular Statement   10000           6750         120%
ResultSet           10000           6203         110%

Sections in This Chapter

JDBC Drivers Tested with Java SE 1.6

Connection URL Formats and Examples

Implementations of the DataSource Interface

Performances on Inserting Rows

Dr. Herong Yang, updated in 2007
Performances on Inserting Rows