Improving JDBC Performance

Several techniques can be used to improve performance while using JDBC drivers.

Note

When using JDBC drivers, the following perform poorly:

  • PL/SQL blocks

  • Methods of DatabaseMetaData

Auto Commits

By default, the JDBC drivers commit INSERTs and UPDATEs immediately after the statement is executed. Autocommit can be set off by using Connection.setAutoCommit(false). This will prevent the automatic commit from occurring after every DML statement. You can use the explicit COMMIT statement to commit the transaction.

Java Threads

It is important to identify Java code and resources that need to be synchronized. If you specify synchronization for Java threads to occur at the method level and the method is large and performs a ...

Get e-Commerce Applications Using Oracle8i and Java from Scratch 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.