Using the table and data source creator with the DB2 v8.2 or v8.1 type 4 JDBC driver

The Table and Data Source Creator supports automatic creation of database tables and associated data sources configured on the application server to make testing CMP beans in the WebSphere® test environment much easier. The version of DB2® supported is DB2 v8.2 and v8.1, by using the Type 4 JDBC driver which will work on both systems that have DB2 v8.2 or v8.1 installed locally or remotely.

In order to generate tables and data sources for DB2, two JAR files must be available on the development machine. One is the JDBC driver itself, contained in a jar file called db2jcc.jar and the other is a license JAR file called db2jcc_license_xxxxx.jar. These JAR files are typically located in the DB2_installdir

/SQLLIB/java (where DB2_installdir is the directory where you have installed DB2). For systems in which DB2 is installed on the development machine, an attempt is made to determine those paths and no further steps are required. If the paths are not automatically determined, specify the paths manually in the dialog box.

If DB2 is installed on a remote machine, supply the full path to both JAR files when the DB2 connection dialog box appears at the time of table creation. No configuration is required as this is done automatically. Failure to supply the path to both JAR files may result in the following exception, both at table creation time and at runtime:

com.ibm.db2.jcc.c.SqlException: The version of the IBM Universal JDBC driver in use is not licensed for connectivity to DB2 for Unix/Windows databases. To connect to this DB2 server, please obtain a licensed copy of the IBM DB2 Universal Driver for JDBC and SQLJ.

A licensed copy of the driver means that db2jcc_license_xxxxx.jar is added to the path to db2jcc.jar. Although only the type 4 driver is supported for the table and data source creator, you are free to manually export your DB2 schemas using the relational database tools.

In the DB2 connection settings dialog box you are asked to provide the path to db2jcc.jar. This implies the path both to this jar and to the license jar. The Browse button allows you to do multiple file selections so what you need to do is to select both the db2jcc.jar file and the db2jcc_license_xxxxx.jar file. If you select only one, the input field will remain blank. You must select both files or manually provide the path to both in order to exit the dialog box and to continue.

 

Related concepts

Data sources

Data sources

 

Related tasks

Creating tables and data sources automatically to test CMP beans

...on WAS v6.1.x

Creating tables and data sources automatically to test CMP beans

...on WAS v6.0.x