Hi everybody.
We have an Application running on a WebSphere Application Server 6.0.2.15. We use Hibernate Version 3.1.3 with IBM DB2 v7.1. Everything is running under z/OS Version 7.
Since the database is running on the same machine, we want to use the IBM DB2 JDBC Universal Driver using JDBC Level 2. For Level 2, the JDBC Driver requires native libraries, which are installed in the correct path in the file system (see below). In the WebSphere administrative console, I have configured the following:
WebSphere Variables:
DB2390_JDBC_DRIVER_PATH: /usr/lpp/db2/db2710
DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH: ${DB2390_JDBC_DRIVER_PATH}/jcc/lib/
DB2UNIVERSAL_JDBC_DRIVER_PATH: ${DB2390_JDBC_DRIVER_PATH}/jcc/classes/
JDBC providers > DB2 Universal JDBC Driver Provider - Settings
Class path:
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar
${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar
Native library path:
${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH}
However, the application does not seem to find the native libraries. When connecting to the database, we get the following exception:
Caused by: com.ibm.db2.jcc.b.SqlException: Failure in loading T2 native library db2jcct2
at com.ibm.db2.jcc.t2.a.a(a.java:31)
at com.ibm.db2.jcc.t2.T2Configuration.<clinit>(T2Configuration.java:74)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:178)
at java.sql.DriverManager.getConnection(DriverManager.java:559)
at java.sql.DriverManager.getConnection(DriverManager.java:158)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
We cannot use a WebSphere Datasource to connect to the database, because it does not work with DB2 v7 on z/OS. So we connect "manually":
Code:
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.DB2390Dialect</property>
<property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.connection.url">jdbc:db2:DATABASENAME</property>
<property name="hibernate.connection.username">USERID</property>
<property name="hibernate.connection.password">PASSWORD</property>
<property name="hibernate.default_schema">QUALIFIER</property>
...
It seems Hibernate does not know about the native library path specified in the JDBC Driver Provider. Does Hibernate even know about the JDBC provider? How can I tell Hibernate where to find the native libraries?
Any help is appreciated! Sorry for the long post ;-)
Greets,
René