Performance and Tuning
There are a number of ways to optimize the performance of an application using jConnect:
Additional considerations for improving performance are described in the following sections.
The JDBC 1.0 specification requires a scale factor with getBigDecimal. Then, when a BigDecimal object is returned from the server, it must be rescaled using the original scale factor you used with getBigDecimal.
To eliminate the processing time required for rescaling, use the JDBC 2.0 getBigDecimal method, which jConnect implements in the SybResultSet class and does not require a scale value:
public BigDecimal getBigDecimal(int columnIndex) throws SQLException
For example:
SybResultSet rs =
(SybResultSet)stmt.executeQuery("SELECT
numeric_column from T1");
while (rs.next())
{
BigDecimal bd rs.getBigDecimal(
"numeric_column");
...
}
You can improve performance on retrieving a result set from the database if you set the REPEAT_READ connection property to "false." However, when REPEAT_READ is "false:"
If you are using multibyte character sets and need to improve driver performance, you can use the SunIoConverter class provided with the jConnect samples. This converter is based on the sun.io classes provided by the Java Software Division of Sun Microsystems, Inc.
The SunIoConverter class is not a pure Java implementation of the character-set converter feature and, therefore, is not integrated with the standard jConnect product. However, Sybase has provided this converter class for your reference, and you can use it with the jConnect driver to improve character-set conversion performance.
Based on Sybase testing, the SunIoConverter class
improved performance on all VMs on which it was tested. However,
the Java Software Division of Sun Microsystems, Inc. reserves the
right to remove or change the sun.io classes
with future releases of the JDK. Therefore, this SunIoConverter class
may not be compatible with later JDK releases.
To use the SunIoConverter class, you must install the jConnect sample applications. Once the samples are installed, set the CHARSET_CONVERTER_CLASS connection property to reference the SunIoConverter class in the sample2 subdirectory under your jConnect installation directory. See the Sybase jConnect for JDBC Installation Guide for complete instructions on installing jConnect and its components, including the sample applications.
If you are using a database with its default character set as iso_1, or if you are using only the first 7 bits of ASCII, you can gain significant performance benefits by using the TruncationConverter. See "jConnect character-set converters".
| Copyright (C) 2005. Sybase Inc. All rights reserved. |
| |