Installing jConnect for JDBC
To install jConnect for JDBC, complete the following tasks:
Before installing jConnect, you must download and install the Java Development Kit (JDK) if developing programs that use jConnect, or the Java Runtime Environment (JRE) based on your needs.
Installing JDK/JRE
This section explains how to download jConnect products from the Web or from a CD.
If you cannot download jConnect from the Sybase Web
site, contact Sybase Technical Support to request a CD. When you
receive the CD, see "lnstalling jConnect
from a CD" for installation instructions.The following instructions apply to standalone jConnect product
downloaded from the Web site or obtained on a CD. If the jConnect
you want to install is part of the Sybase Software Developer's
Kit (SDK) or any other Sybase product, please refer to the Installation
Guide for that product for installation instructions.
Installing jConnect from the Web
lnstalling jConnect from a CD
Use these instructions only
if
you requested a jConnect CD because you cannot download jConnect
from the Web. Do not use these instructions to install the version
of jConnect included with Adaptive Server Enterprise or other Sybase
products. Instead, use the installation guide provided.
To use the jConnect classes you installed, you must set the JDBC_HOME and CLASSPATH environment variables.
JDBC_HOME represents the directory in which you install jConnect. For example:
The zip file is not aware of your
directory structure and installs everything below a directory with
the specific jConnect driver's name.
C:\Sybase\jConnect-6_0
/usr/local/Sybase/jConnect-6_0
CLASSPATH is the location of the jConnect runtime classes and/or jar files for JDK 1.4.x or later. This section describes what you need in your CLASSPATH depending on which versions of JDK and jConnect you are using.
To use jConnect 6.05 with JDK versions 1.4.x and later, add the following path to the CLASSPATH environment variable:
To run the samples or the TDS-tunnelling servlet, add the following to the CLASSPATH environment variable:
Sybase requires that you run JDK 1.4.2 or later with
jConnect 6.05.
In addition, the CLASSPATH should include the location of any application classes you have defined.
If you use Netscape, some restrictions may apply to the way you set your CLASSPATH environment variable.
The Java VM security manager will not allow a version of jConnect installed in your local file system to create a connection to a server, even if the server is your local system. This can create a problem if you use Netscape to run an applet that uses jConnect.
When Netscape needs to load jConnect to create a connection to a server, it looks for a CLASSPATH defined in its environment to find the jConnect classes. If it finds a CLASSPATH that you have defined to point to your local jConnect installation, it loads jConnect directly from the local file system--rather than from the server--and tries to create a connection. This generates a security error and the connection fails.
In summary, if you are using Netscape to run jConnect applets, do not set the CLASSPATH to the local jConnect directory.
For jConnect to function properly, you must install stored procedures and tables on the Adaptive Server Enterprise or Adaptive Server Anywhere database to which your application will be connecting. jConnect provides the following scripts to install the required stored procedures and tables:
If you use ASE 12.5.3 or later, or ASA 9.0.2 or later,
the scripts come pre-installed on the server. You will need to install
these scripts only if you have a later version of the driver than
the one that shipped with ASE. In addition, for backward compatibility, sql_server.sql and sql_server12.sql are included
on ASE 11.9.2 and 12.0 respectively, although these versions are
no longer supported.
Running stored-procedure installation scripts
The following describes how to install stored procedures for metadata in an Adaptive Server Enterprise database using Windows, UNIX, and Linux.
Installing stored procedures on Windows
java IsqlApp -U sa -P password -S jdbc:sybase:
Tds:[hostname]:[port] -I %JDBC_HOME%\sp\sql_server15.0.sql -c go
java IsqlApp -U sa -P password -S jdbc:sybase:
Tds:[hostname]:[port] -I %JDBC_HOME%\sp\sql_server12.5.sql -c go
Installing stored procedures on UNIX and Linux
java IsqlApp -U sa -P password -S jdbc:sybase:
Tds:[hostname]:[port] -I $JDBC_HOME/sp/sql_server15.0.sql -c go
java IsqlApp -U sa -P password -S jdbc:sybase:
Tds:[hostname]:[port] -I $JDBC_HOME/sp/sql_server12.5.sql -c go
The following describes how to install stored procedures for metadata in a SQL Anywhere or Adaptive Server Anywhere database using Windows, UNIX, and Linux.
Installing stored procedures on Windows
java IsqlApp -U dba -P password -S jdbc:sybase:
Tds:[hostname]:[port] -I %JDBC_HOME%\sp\sql_asa.sql -c go
Installing stored procedures on UNIX and Linux
java IsqlApp -U dba -P password -S jdbc:sybase:
Tds:[hostname]:[port] -I $JDBC_HOME/sp/sql_asa.sql -c go
After completing the jConnect installation, review the contents listed in this section.
For jConnect version 6.05, the following packages are found
inside jar files
( jconn3.jar for
the release build and jconn3d.jar for the debug
build):
The jConnect driver, com.sybase.jdbc3.jdbc.SybDriver, is located in the com.sybase.jdbc3.jdbc package.
Table 1-3 lists the directories and files in jconnect605.zip.
| Name | Type | Description |
|---|---|---|
| jconnect-6_0 | Directory | Contains all of the jConnect version 6.05 files and subdirectories. |
| classes | Subdirectory | Contains the following
jConnect 6.05 components:
|
| devclasses | Subdirectory | Contains the jconn3d.jar file that contains the same jConnect 6.05 components as jconn3.jar, but debug mode is turned on. |
| docs | Subdirectory | Contains the:
|
| gateway2 | Subdirectory | Contains source code for the TDS-tunnelling servlet. |
| sample2 | Subdirectory | Contains source code for sample Java applications. |
| sp | Subdirectory | Contains isql scripts
that install stored procedures for function escapes and DatabaseMetaData methods
on a database server. The scripts are:
|
| tools | Subdirectory | Contains a perl script (decode-tli) that UNIX or Linux users can apply to parse an interfaces file into a readable format. |
| netimpct.gif | Graphic file | Contains a jConnect graphic. |
| index.html | HTML file | Contains links to jConnect documentation and jConnect samples. |
You can find JDBC 2.0 code samples in the sample2 subdirectory under the jConnect installation directory. For more information, see "jConnect Sample Programs," in Appendix B of the jConnect for JDBC Programmer's Reference.
The JDBC 3.0 specification provides much new functionality unavailable in the JDBC 2.0 specification. jConnect 6.05 contains the methods offered in the JDBC 3.0 specification; however some are not implemented. Applications that invoke any un-implemented JDBC 3.0 methods receive a SQL exception indicating that the method has not been implemented.
Future versions of jConnect will support the missing JDBC 3.0 features.
After jConnect is installed, test the installation by running the Version program.
The Version program connects to a
demonstration database that Sybase has made available on the Internet.
You must have Internet access to run the Version program
successfully, or explicitly run it with [-U username]
[-P password] [-S servername] commands
to point it to your database.
Testing the installation
java sample2.SybSample Version
Using JDBC driver version 6.05 jConnect (TM) for JDBC(TM)/6.05...
java.io.FileNotFoundException: Version.java
Can't find class sample2.SybSample
"Name specified is not recognized as an internal or external command" (Windows NT)
"Bad command or file name" (Windows 95)
The following describes how to check the exact build version of your jConnect installation.
Verifying the build version of the installation
java -jar jconn3.jar
This command prints a version string like the following:
jConnect (TM) for JDBC(TM)/6.05(Build 25773/P/EBF12723/JDK14/Fri Aug 5 0:05:43 2005
Here, the version number is 6.05. The 5-digit number following the letters "EBF" indicates the exact version of jConnect. This number increases as subsequent EBFs are released.
Sybase recommends that you check the Sybase download Web site periodically for updated versions of jConnect and download the latest version.
| Copyright (C) 2005. Sybase Inc. All rights reserved. |
| |