Hi there,
using the udb-type2-driver on z/OS DB version 7, we have a problem
getting the connection to the database. The small program we use looks
like this:
Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection connection = DriverManager.getConnection(
"jdbc:db2:<database-name>", "<user>", "<password>" );
Unfortunetely, at this line, we get the following error message at
runtime (stacktrace):
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>(T2Conf iguration.java:74)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 78)
at java.sql.DriverManager.getConnection(DriverManager .java:539)
at ...
The shell-script we are using to call the program has included these
libraries:
CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc.jar
CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc_license_cisuz.jar
CP=$CP:/RIS/db2/zamt/jcc/lib
Additionally, also these files are included, but should not have any
effects:
CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc_javax.jar
CP=$CP:/RIS/db2/zamt/jcc/classes/sqlj.zip
Does anyone know, why the exception above occurs? Depending on the
information of the database administration, all necessary libraries are
installed and all packages bound. Really?
Many thanks for your answers.
Ralf 3 2562 rj**@gmx.de wrote: Hi there,
using the udb-type2-driver on z/OS DB version 7, we have a problem getting the connection to the database. The small program we use looks like this:
Class.forName("com.ibm.db2.jcc.DB2Driver"); Connection connection = DriverManager.getConnection( "jdbc:db2:<database-name>", "<user>", "<password>" );
Unfortunetely, at this line, we get the following error message at runtime (stacktrace):
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>(T2Conf iguration.java:74) at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 78) at java.sql.DriverManager.getConnection(DriverManager .java:539) at ...
The shell-script we are using to call the program has included these libraries:
CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc.jar CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc_license_cisuz.jar CP=$CP:/RIS/db2/zamt/jcc/lib
Additionally, also these files are included, but should not have any effects:
CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc_javax.jar CP=$CP:/RIS/db2/zamt/jcc/classes/sqlj.zip
Does anyone know, why the exception above occurs? Depending on the information of the database administration, all necessary libraries are installed and all packages bound. Really?
Many thanks for your answers.
Ralf
Hi Ralf. The problem is not in your classpath, but in the library
path where an OS process finds it's native libraries. If you must
use a type-2 driver you have to also configure your JVM processes
library path to explicitly include the driver's native library
component, as well as the DBMS client libraries and they typical
OS libraries.
Joe Weinstein at BEA
Hi,
thanks for your fast answer - now it works ...
Unfortunately, another problem occured. Using the type 2-driver and
doing database operations without sending an explicit commit
(autocommit was set to false), the connection itself will do a commit.
Even if the program is killed during operation.
Does anyone know a solution for this or is this still a bug from ibm?
Using type 4-driver, there will be done a rollback operation if killing
the program etc.
Thanx, Ralf
Joe Weinstein wrote: rj**@gmx.de wrote:
Hi there,
using the udb-type2-driver on z/OS DB version 7, we have a problem getting the connection to the database. The small program we use looks like this:
Class.forName("com.ibm.db2.jcc.DB2Driver"); Connection connection = DriverManager.getConnection( "jdbc:db2:<database-name>", "<user>", "<password>" );
Unfortunetely, at this line, we get the following error message at runtime (stacktrace):
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>(T2Conf iguration.java:74) at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 78) at java.sql.DriverManager.getConnection(DriverManager .java:539) at ...
The shell-script we are using to call the program has included these libraries:
CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc.jar CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc_license_cisuz.jar CP=$CP:/RIS/db2/zamt/jcc/lib
Additionally, also these files are included, but should not have any effects:
CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc_javax.jar CP=$CP:/RIS/db2/zamt/jcc/classes/sqlj.zip
Does anyone know, why the exception above occurs? Depending on the information of the database administration, all necessary libraries are installed and all packages bound. Really?
Many thanks for your answers.
Ralf
Hi Ralf. The problem is not in your classpath, but in the library path where an OS process finds it's native libraries. If you must use a type-2 driver you have to also configure your JVM processes library path to explicitly include the driver's native library component, as well as the DBMS client libraries and they typical OS libraries. Joe Weinstein at BEA rj**@gmx.de wrote: Hi,
thanks for your fast answer - now it works ...
Unfortunately, another problem occured. Using the type 2-driver and doing database operations without sending an explicit commit (autocommit was set to false), the connection itself will do a commit. Even if the program is killed during operation.
Does anyone know a solution for this or is this still a bug from ibm? Using type 4-driver, there will be done a rollback operation if killing the program etc.
Thanx, Ralf
Glad to help. The JDBC spec isn't defined as to whether pending transactional
state is committed or rolled back on connection close, but it seems horrible
if a program fault or external kill can force a possibly incomplete transaction
to commit. Fortunately you have a type-4 driver which behaves as I'd expect.
Unless it's prohibitively slower or buggy, I'd highly recommend you stick with
an all-Java solution.
Joe Weinstein at BEA Systems
Joe Weinstein wrote:
rj**@gmx.de wrote:
Hi there,
using the udb-type2-driver on z/OS DB version 7, we have a problem getting the connection to the database. The small program we use looks like this:
Class.forName("com.ibm.db2.jcc.DB2Driver"); Connection connection = DriverManager.getConnection( "jdbc:db2:<database-name>", "<user>", "<password>" );
Unfortunetely, at this line, we get the following error message at runtime (stacktrace):
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>(T2C onfiguration.java:74) at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 78) at java.sql.DriverManager.getConnection(DriverManager .java:539) at ...
The shell-script we are using to call the program has included these libraries:
CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc.jar CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc_license_cisuz.jar CP=$CP:/RIS/db2/zamt/jcc/lib
Additionally, also these files are included, but should not have any effects:
CP=$CP:/RIS/db2/zamt/jcc/classes/db2jcc_javax.jar CP=$CP:/RIS/db2/zamt/jcc/classes/sqlj.zip
Does anyone know, why the exception above occurs? Depending on the information of the database administration, all necessary libraries are installed and all packages bound. Really?
Many thanks for your answers.
Ralf
Hi Ralf. The problem is not in your classpath, but in the library path where an OS process finds it's native libraries. If you must use a type-2 driver you have to also configure your JVM processes library path to explicitly include the driver's native library component, as well as the DBMS client libraries and they typical OS libraries. Joe Weinstein at BEA
This discussion thread is closed Replies have been disabled for this discussion. Similar topics
27 posts
views
Thread by Raquel |
last post: by
|
17 posts
views
Thread by Bruce Jin |
last post: by
|
2 posts
views
Thread by Vikrant |
last post: by
|
4 posts
views
Thread by Pete H |
last post: by
|
4 posts
views
Thread by erkki |
last post: by
|
2 posts
views
Thread by db2group88 |
last post: by
|
3 posts
views
Thread by claus.hirth |
last post: by
|
2 posts
views
Thread by Laurence |
last post: by
|
3 posts
views
Thread by Dal Mon |
last post: by
| | | | | | | | | | | |