JDBC Type 4 Driver Performance Tuning Guide for Version 1.1
HP NonStop JDBC Type 4 Driver
Performance Tuning Guide for Version 1.0
Page 2 Hewlett-Packard Company — 529619-002 April 8, 2005
3 NonStop JDBC Type 4 Driver Tuning Tips
3.1 Configuration Tips
• Use connection pooling either explicitly with your own implementation, the
Type 4 driver connection pooling mechanism (the default is no connection
pooling), or implicitly through a product that supports connection pooling, such as
BEA Weblogic Server, IBM WebSphere, etc.
• Use the maxPoolSize and minPoolSize properties to tune the connection pool.
The default maxPoolSize and minPoolSize is -1, “no connection pooling.”
• Set minPoolSize to the anticipated number of connections to be used. For
example, set minPoolSize to the number of application threads.
• Set the maxStatements property to enable statement pooling (the default is no
statement pooling). For example, SQLMXDataSource.setMaxStatements(100).
• Turn off logging. Set the T4LogLevel property to OFF (the default is OFF). Set
the DriverManager.setLogWriter() and/or DataSource.setLogWriter() methods to
null (the default is null).
• Increase or decrease the Java virtual machine (JVM) heap size to balance
performance versus memory usage. The Type 4 driver creates objects that must be
garbage collected by the JVM. For additional information on JVM heap
optimization, see the documents, Tuning Garbage Collection with the 1.4.2
Java™ Virtual Machine at http://java.sun.com/docs/hotspot/gc1.4.2/ and Turbo-
charging Java HotSpot Virtual Machine, v1.4.x to Improve the Performance and
Scalability of Application Servers at
http://java.sun.com/developer/technicalArticles/Programming/turbo/.
• Turn off translation Verification. Set the translationVerification property to false
(the default is false).
3.2 Design and Programming Tips
• Do not use the same connection simultaneously in different threads. The
connection’s operations will be serialized. Use different connections with
different threads to get parallel execution.
• Use the same connection to execute multiple statements. Closing and reopening a
connection can be very costly.
• Use prepared statements (PreparedStatement class), and parameterize its
arguments.
• Avoid retrieving unnecessary columns: don't use "SELECT *".