Migrating jConnect applications  Sybase extensions

Chapter 5: Migrating jConnect Applications

Migrating applications to jConnect 4.5 and 5.5

If you upgrade to jConnect 4.5 or 5.5 from earlier versions, the following table shows which upgrade paths require you to make changes and recompile the source code.

Legend:

A     Change CLASSPATH for new installation structure

B     Recompile to use new jConnect 5.x driver

C     Verify that the new driver is first in your CLASSPATH.

See below for additional details.

Upgrading from

To jConnect version

jConnect version

4.5

5.2

5.5

4.2/4.5

A

BC

BC

5.2

-

-

A

A. Use the new Sybase extensions.

  1. Change package imports from

    import com.sybase.jdbc.*

    to

    import com.sybase.jdbcx.*;

  2. Use new Sybase extentions APIs. See “Sybase extensions”.

A. Change CLASSPATH for new JDBC_HOME installation structure

Set JDBC_HOME to the top directory of the jConnect driver you installed. For example:

For jConnect 4.5:

JDBC_HOME=jConnect-4_5

For jConnect 5.5:

JDBC_HOME=<jConnect installation directory>

For more information on setting JDBC_HOME, see “Setting Environment Variables” in Chapter 1 of the jConnect for JDBC Installation Guide.

Version change

CLASSPATH includes

From

4.2/4.5

JDBC_HOME/classes

To

5.2

JDBC_HOME/jconn2.jar

From

4.2

JDBC_HOME/classes

To

4.5

JDBC_HOME/classes

From

5.2

JDBC_HOME/classes/jconn2.jar

To

5.5

JDBC_HOME/classes/jconn2.jar

B. Recompile to use new jConnect 5.x driver

Change the source code where the driver is loaded from:

Class.forName("com.sybase.jdbc.SybDriver");

to

Class.forName("com.sybase.jdbc2.jdbc.SybDriver");

C. Verify that new jConnect driver is in CLASSPATH

To verify that the new jConnect driver is first in your CLASSPATH, display your CLASSPATH and find the directory where you installed the new jConnect driver.

Verify that the classes for the new driver (in the classes/jconn2.jar for 5.x) appear in the CLASSPATH before the classes for any previously installed driver.





Copyright © 2003. Sybase Inc. All rights reserved. Sybase extensions

View this book as PDF