By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,514 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,514 IT Pros & Developers. It's quick & easy.

Need Help: Using UDB-Type2-Driver on z/OS DB2 version 7

P: n/a
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

Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a


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

Nov 12 '05 #2

P: n/a
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


Nov 12 '05 #3

P: n/a
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



Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.