To determine the version of the JDBC driver, use the
getMetaData() method on the connection object. You can use the following
Java™ code with any JDBC Driver to print out the version:
import java.sql.*;
import java.io.*;
public class Version {
public static void main (String args[])
{
try
{
/*This same uses the DB2 driver. Change
the class name if you are using a different driver*/
Class.forName("com.ddtek.jdbc.db2.DB2Driver").newInstance();
/* This sample uses a connection URL to
a DB2 database on Windows or Unix with a package already created. Modify
the URL as needed to create a package or connect to a different
database. */
Connection con =
DriverManager.getConnection("jdbc:db2:<databaseName>","uid","pwd");
DatabaseMetaData dmd = con.getMetaData();
System.out.println("JDBC Driver version: " +
dmd.getDriverVersion());
}
catch(Exception e)
{
System.out.println(" Exception = " + e
);
}
}
}
You must add the JDBC Driver .jar files to the environment variable
CLASSPATH.
Here is the list of class names for all the JDBC Drivers supported by
WebSphere Application Server:
DB2 App Driver
COM.ibm.db2.jdbc.app.DB2Driver
DB2 Net Driver
COM.ibm.db2.jdbc.net.DB2Driver
Oracle JDBC Driver
oracle.jdbc.driver.OracleDriver
Informix Driver
com.informix.jdbc.IfxDriver
Sybase jConnect Driver
com.sybase.jdbc2.jdbc.SybDriver
SequeLink JDBC Driver
com.merant.sequelink.jdbcx.datasource.SequeLinkDataSource
Connect JDBC Driver
com.ibm.websphere.jdbcx.sqlserver.SQLServerDataSource
For SequeLink JDBC Driver
With SequeLink JDBC versions 5.0 and above, an extension is added that
you can use to determine the version of the driver. The driver's class
implements the main() method, which reports its version to standard
output.
- Set up the environment variable CLASSPATH to include the SequeLink for
JDBC driver's jar files depending on the version of SequeLink JDBC driver:
For SequeLink JDBC Driver versions 5.0 and 5.2:
Windows®:
c:\> set
CLASSPATH=$WAS_HOME\lib\sljc.jar;$WAS_HOME\lib\sljcx.jar;%CLASSPATH%
Unix®:
export CLASSPATH=$WAS_HOME/lib/sljc.jar:$CLASSPATH
For SequeLink JDBC Driver versions 5.3 and higher:
Windows:
c:\> set CLASSPATH=$WAS_HOME\lib\sljc.jar;%CLASSPATH%
Unix:
export CLASSPATH=$WAS_HOME/lib/sljc.jar:jar:$CLASSPATH
The JDBC Driver's jar file(s) are different for different version of
SequeLink JDBC Driver.
- Execute the following command depending on the version of SequeLink
JDBC Driver:
For SequeLink JDBC Driver version 5.1 or 5.2
c:\> java com.merant.sequelink.jdbc.SequeLinkDriver
For SequeLink JDBC versions 5.3 or higher:
java com.ddtek.jdbc.sequelink.SequeLinkDriver
For example:
C:\>java com.ddtek.jdbc.sequelink.SequeLinkDriver
[DataDirect][SequeLink JDBC Driver]Driver Version: 5.3.0019
|