Abstract

The driver aims to be JDBC compliant. Compliance can be tested with the JDBC Client test suite. This document describes how to set up the Test Suite to run with the jxDBCon driver.

Unfortunately the JDBC CTS is a quite complex system including several applications that need to be configured properly. This guideluine cannot be exhaustive. If you encounter problems, feel free to ask on the project page for help.

Installation

First of all you need to install the appropriate versions of the software products involved. It is recommended that you start from a clean system. Especially you must ensure that there is no CLASSPATH set in your environment. The products are:
  1. Java2 Development Kit 1.3.1_02.
  2. Java2 Enterprise Edition 1.3.1.
  3. JDBC CTS 1.3.1. Please read the installation notes carefully. Setting up the CTS is not trivial.
  4. Copy the PostgreSQL database test definition files to $CTS_HOME/bin. Make a softlink from ctssql.stmt to ctssql.dml.postgresql, replacing the original file.

The customized DDL/DML files are:

Copying the driver JAR

The driver JAR file must be placed in $J2EESDK_HOME/lib/system. The following will assume that you use jxDBCon-jdbc-0.9y.jar. Note that you have to use a driver which was compiled with the 1.3.1 version of the JDK. A driver compiled with 1.4.0 will not work!

Changing J2EE configuration file

Edit $J2EESDK_HOME/bin/userconfig.sh and add the jars. At line 10 append the following.
CTS_CP=/opt/java/jdbccts-1.3.1/lib/j2eects.jar
JX_CP=/opt/j2sdkee1.3.1/lib/system/jxDBCon-jdbc3-0.9x.jar

export J2EE_CLASSPATH=$CTS_CP:$JX_CP

Adding the driver and the data source

Issue the following commands:
j2eeadmin -addJdbcDriver org.sourceforge.jxdbcon.JXDBConDriver
j2eeadmin -addJdbcDatasource jdbc/DB1 "jdbc:postgresql:net///db1"

j2eeadmin -listJdbcDriver
j2eeadmin -listJdbcDatasource

Changes in $CTS_HOME/cts_env

Besides the changes that are described in the CTS setup HOWTO you need to additionally perform this configuration items.

Include the jxDBCon driver JAR file in the CLASSPATH:

# Settings for Vendor J2EE Implementation
J2EE_HOME=/opt/j2sdkee1.3.1
ORB_HOST=localhost
ORB_PORT=1050
LOCAL_CLASSES=${J2EE_HOME}/lib/cloudscape/RmiJdbc.jar:${J2EE_HOME}/lib/cloudscape/cloudclient.jar:${J2EE_HOME}/lib/system/jxDBCon-jdbc2-0.9y.jar

# Settings for Sun RI J2EE Implementation
J2EE_HOME_RI=/opt/j2sdkee1.3.1
ORB_HOST_RI=localhost
ORB_PORT_RI=1050
LOCAL_CLASSES_RI=${J2EE_HOME_RI}/lib/cloudscape/RmiJdbc.jar:${J2EE_HOME_RI}/lib/cloudscape/cloudclient.jar:${J2EE_HOME_RI}/lib/system/jxDBCon-jdbc2-0.9y.jar
Comment out the Cloudscape properties and add the PostgreSQL values:
# Default values for Cloudscape
#DBUSER=cts1
#DBPASSWD=cts1
#DBURL="jdbc:cloudscape:rmi:CloudscapeDB;create=true"
#DBDRIVER=COM.cloudscape.core.RmiJdbcDriver
#DDLFILE=${CTS_HOME}/bin/ctssql.ddl.cloudscape

#Default values for PostgreSQL
DBUSER=cts1
DBPASSWD=cts1
DBURL="jdbc:postgresql:net//akira:9720/db1"
DBDRIVER=org.sourceforge.jxdbcon.JXDBConDriver
DDLFILE=${CTS_HOME}/bin/ctssql.ddl.postgresql
Add the driver JAR to the initdb's classpath aswell:
JDBC_CLASSPATH=${J2EE_HOME_RI}/lib/cloudscape/RmiJdbc.jar:${J2EE_HOME_RI}/lib/cloudscape/cloudclient.jar:${J2EE_HOME_RI}/lib/system/sljc.jar:${J2EE_HOME_RI}/lib/system/sljcx.jar:${J2EE_HOME_RI}/lib/system/jxDBCon-jdbc2-0.9y.jar

Setting up the database

Create the databases and test users with psql.
create database db1
create user cts1 with password 'cts1'

Running the tests

Start J2EE. In another shell set up the necessary shell environment and make a rtest run:
export JAVA_HOME={your jdk1.3.1_02 directory}
export J2EE_HOME={your j2ee1.3.1 directory}
export CTS_HOME=/opt/java/jdbccts-1.2.1a
export NO_JAVATEST=Y
cd $CTS_HOME/tests/jdbc/ee
ctsmake jdbc-tests
You may want to change the Makefile to only run a subset of the test suite. Uncomment the line that defines the test suite subdirectories: #SUBDIRS = common dbMeta rsMeta resultSet batchUpdate prepStmt escapeSyntax dateTime exception stmt connection callStmt and replace it with a subset: SUBDIRS = common dbMeta Note: All tests in dbMeta must succeed. Otherwise your test setup is broken.

Analyzing test logs

Postprocess the result log with the AWK script in the support section.