Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

<geronimo_home>\repository\db2\jars

Note

The db2\jars directory used in this article is just an example. As Apache Geronimo moves forward and use Maven2 for instance, all the content in the repository will be organized in packages. You may want to consider using a naming like com.ibm.db2 in your testings and future implementations.

Copy the following files from <sqllib_home>\java to the <geronimo_home>\repository\db2\jars directory.

  • db2jcc.jar - This is the actual DB2 Universal JDBC Driver jar file.
  • db2jcc_license_

...

  • cu.jar - This is the standard DB2 Universal JDBC driver license file that allows access to the DB2 Universal database for Linux, UNIX and Windows servers.
  • db2jcc_license_cisuz.jar - This is the DB2 (DB2 ESE and DB2 Connect) JDBC Driver license for z/OS and iSeries that should be used in addition to the standard license for these servers.

For additional information on the DB2 JDBC drivers and licenses visit the DB2 Information Center available at the following URL:

http://publib.boulder.ibm.com/infocenter/db2luw/v8/topic/com.ibm.db2.udb.doc/ad/t0010264.htm

cu.jarRename the files you just copied so Geronimo can recognize them.

Original name

Renamed

db2jcc.jar

db2jcc-8.1.8.jar

db2jcc_license_cisuzcu.jar

db2jcc_license_cisuzcu-8.1.8.jar

db2jcc_license_cucisuz.jar

db2jcc_license_cucisuz-8.1.8.jar

For this particular case DB2 v8.1.8.806 was used. Failing to rename these files will cause the server to throw an exception.

...

Once the server is started open the Geronimo Administration Console by pointing a Web browser to the following URL:

http://localhost:8080/consoleImage Removed

Enter system and manager as the username and password.

...

Enter the remanining connection information as shown in the following figure. For this example the default db2admin user and password was used . Also and a SAMPLE database was created via the DB2 Control Center.

Click Next.

Leave the options on Step 3 by default, you should see the message Driver Status: Loaded Successfully.

...

No Format
borderStylesolid
titleExcerpt from the Test Result: _Connection Error_
com.ibm.db2.jcc.c.SqlException: The version of the IBM Universal JDBC driver in use is not licensed for connectivity to QDB2/NT databases.  
To connect to this DB2 server, please obtain a licensed copy of the IBM DB2 Universal Driver for JDBC and SQLJ.  
An appropriate license file db2jcc_license_*.jar for this target platform must be installed to the application classpath.  
Connectivity to QDB2/NT databases is enabled by any of the following license files: { db2jcc_license_cu.jar, db2jcc_license_cisuz.jar }
	at com.ibm.db2.jcc.c.o.db(o.java:3103)
	at com.ibm.db2.jcc.c.o.cb(o.java:3049)
	at com.ibm.db2.jcc.b.b.cb(b.java:629)
	at com.ibm.db2.jcc.b.b.<init>(b.java:306)
	...

...

Code Block
xml
xml
borderStylesolid
titleWizard generated deployment plan
<?xml version="1.0" encoding="UTF-8"?>
<connector 
	configId="user/database-pool-DB2_Test/1/car" 
	xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.0">
    	<dep:dependency xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.0">
        		<dep:uri>db2/db2jcc/8.1.8/jar</dep:uri>
    	</dep:dependency>
    <resourceadapter>
        
	
	<resourceadapter>
		<outbound-resourceadapter>
            		<connection-definition>
                			<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
                				<connectiondefinition-instance>
                    					<name>DB2_Test</name>
                    					<config-property-setting name="Password">db2admin</config-property-setting>
                    					<config-property-setting name="CommitBeforeAutocommit">false</config-property-setting>
                    					<config-property-setting name="Driver">com.ibm.db2.jcc.DB2Driver</config-property-setting>
                    					<config-property-setting name="ExceptionSorterClass">org.tranql.connector.AllExceptionsAreFatalSorter</config-property-setting>
                    					<config-property-setting name="UserName">db2admin</config-property-setting>
                    					<config-property-setting name="ConnectionURL">jdbc:db2://localhost:50000/SAMPLE</config-property-setting>
                    <connectionmanager>
                        					<connectionmanager>
						<local-transaction/>
                        <single-pool>
                            						<single-pool>
							<match-one/>
                        						</single-pool>
                    					</connectionmanager>
                				</connectiondefinition-instance>
            			</connection-definition>
        		</outbound-resourceadapter>
    	</resourceadapter>
</connector>

...

Code Block
xml
xml
borderStylesolid
titleUpdated db2_plan.xml deployment plan
<?xml version="1.0" encoding="UTF-8"?>
<connector 
	configId="user/database-pool-DB2_Test/1/car" 
	xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.0">

<!-- #####        COMMENT OUT THIS SECTION      ##### -->
<!--										-->
<!--    <dep:dependency xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.0">	-->
<!--        <dep:uri>db2/db2jcc/8.1.8/jar</dep:uri>					-->
<!--    </dep:dependency>

								##### -->



<!-- ##### ADD THE FOLLOWING THREE DEPENDENCIES ##### -->
		<dependency>
			<uri>db2/db2jcc/8.1.8/jar</uri>
		</dependency>

		<dependency>
			<uri>db2/db2jcc_license_cu/8.1.8/jar</uri>
		</dependency>

		<dependency>
			<uri>db2/db2jcc_license_cisuz/8.1.8/jar</uri>
		</dependency>


<!-- #####  THE REMAINING PART DOES NOT CHANGE  ##### -->
	
	<resourceadapter>
		<outbound-resourceadapter>
			<connection-definition>
                			<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
                				<connectiondefinition-instance>
                    					<name>DB2_Test</name>
                    					<config-property-setting name="Password">db2admin</config-property-setting>
                    					<config-property-setting name="CommitBeforeAutocommit">false</config-property-setting>
                    					<config-property-setting name="Driver">com.ibm.db2.jcc.DB2Driver</config-property-setting>
                    					<config-property-setting name="ExceptionSorterClass">org.tranql.connector.AllExceptionsAreFatalSorter</config-property-setting>
                    					<config-property-setting name="UserName">db2admin</config-property-setting>
                    					<config-property-setting name="ConnectionURL">jdbc:db2://localhost:50000/SAMPLE</config-property-setting>
                    <connectionmanager>
                        					<connectionmanager>
						<local-transaction/>
                        <single-pool>
                            						<single-pool>
							<match-one/>
                        						</single-pool>
                    					</connectionmanager>
                				</connectiondefinition-instance>
            			</connection-definition>
        		</outbound-resourceadapter>
    	</resourceadapter>
</connector>

...