If most dynamic statements are executed many times in a session  DYNAMIC_PREPARE connection property

Chapter 4: Performance and Tuning

Connection.prepareStatement( )

jConnect implements Connection.prepareStatement( ) so you can set it to return either precompiled SQL statements or uncompiled SQL statements in PreparedStatement objects. If you set Connection.prepareStatement( ) to return precompiled SQL statements in PreparedStatement objects, it sends dynamic SQL statements to the database to be precompiled and saved exactly as they would be under direct execution of the prepare command. If you set Connection.prepareStatement( ) to return uncompiled SQL statements, it returns them in PreparedStatement objects without sending them to the database.

The type of SQL statement that Connection.prepareStatement( ) returns is determined by the connection property DYNAMIC_PREPARE, and applies throughout a session.

For Sybase-specific applications, jConnect 5.5 provides a prepareStatement( ) method under the jConnect SybConnection class. SybConnection.prepareStatement( ) allows you to specify whether an individual dynamic SQL statement is to be precompiled, independent of the session-level setting of the DYNAMIC_PREPARE connection property.





Copyright © 2003. Sybase Inc. All rights reserved. DYNAMIC_PREPARE connection property

View this book as PDF