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.
CLASSPATH set in your environment. The products are:
ctssql.stmt to ctssql.dml.postgresql, replacing the original file.
$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!
$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
j2eeadmin -addJdbcDriver org.sourceforge.jxdbcon.JXDBConDriver j2eeadmin -addJdbcDatasource jdbc/DB1 "jdbc:postgresql:net///db1" j2eeadmin -listJdbcDriver j2eeadmin -listJdbcDatasource
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
create database db1 create user cts1 with password 'cts1'
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.