473,223 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,223 software developers and data experts.

JDBC Connection on AIX and DB2 7.2.4

hi there,

i have a problem connecting to a db2 database 7.2.4 on AIX using java
when running the javacode on AIX using jdk1.3.1.
The classpath is correctly set to java12/...

on windows the following code works fine for the same database:

DB2XADataSource db2 = new DB2XADataSource();
db2.setDatabaseName("MYDB");
db2.setPassword("test1");
db2.setUser("test1");
xaconnection = db2.getXAConnection();
connection = xaconnection.getConnection();

the database MYDB is configured in the client configuration assistant
on the windows machine

on the AIX machine xaconnection.getConnection() returns null
not even an exception is thrown
i cant figure out why that happens. I tried to set additional
properties
on the DB2XADataSource object, like port and servername, but I still
cant get a connection.

Does anybody know how to get the connection or
how to get more error or trace information.

Thank you.

Steffen
Nov 12 '05 #1
5 5605
By default, db2 would use IPC communication when you try to build local
application.
catalog the database as tcpip data sources, then try again.

"Steffen" <gl*****@gmx.net> wrote in message
news:f7*************************@posting.google.co m...
hi there,

i have a problem connecting to a db2 database 7.2.4 on AIX using java
when running the javacode on AIX using jdk1.3.1.a
The classpath is correctly set to java12/...

on windows the following code works fine for the same database:

DB2XADataSource db2 = new DB2XADataSource();
db2.setDatabaseName("MYDB");
db2.setPassword("test1");
db2.setUser("test1");
xaconnection = db2.getXAConnection();
connection = xaconnection.getConnection();

the database MYDB is configured in the client configuration assistant
on the windows machine

on the AIX machine xaconnection.getConnection() returns null
not even an exception is thrown
i cant figure out why that happens. I tried to set additional
properties
on the DB2XADataSource object, like port and servername, but I still
cant get a connection.

Does anybody know how to get the connection or
how to get more error or trace information.

Thank you.

Steffen

Nov 12 '05 #2
What is the better way to connect to the database (icp i assume)?
ipc oder TCP

How can i catalog a Database as tcpip data source?
and how can i find out how the database is currently cataloged ?

Thanks for your first answer.
Steffen
"Fan Ruo Xin" <fa*****@sbcglobal.net> wrote in message news:<LG***************@newssvr32.news.prodigy.com >...
By default, db2 would use IPC communication when you try to build local
application.
catalog the database as tcpip data sources, then try again.

"Steffen" <gl*****@gmx.net> wrote in message
news:f7*************************@posting.google.co m...
hi there,

i have a problem connecting to a db2 database 7.2.4 on AIX using java
when running the javacode on AIX using jdk1.3.1.a
The classpath is correctly set to java12/...

on windows the following code works fine for the same database:

DB2XADataSource db2 = new DB2XADataSource();
db2.setDatabaseName("MYDB");
db2.setPassword("test1");
db2.setUser("test1");
xaconnection = db2.getXAConnection();
connection = xaconnection.getConnection();

the database MYDB is configured in the client configuration assistant
on the windows machine

on the AIX machine xaconnection.getConnection() returns null
not even an exception is thrown
i cant figure out why that happens. I tried to set additional
properties
on the DB2XADataSource object, like port and servername, but I still
cant get a connection.

Does anybody know how to get the connection or
how to get more error or trace information.

Thank you.

Steffen

Nov 12 '05 #3
Steffen wrote:
What is the better way to connect to the database (icp i assume)?
ipc oder TCP
IPC is faster but it requires that your client is on the same machine as
your server.
How can i catalog a Database as tcpip data source?
Have a look at the following DB2 commands:

CATALOG TCPIP NODE ...
CATALOG DATABASE ... AT NODE ...
and how can i find out how the database is currently cataloged ?


LIST DATABASE DIRECTORY

--> that tells you the node for each database and

LIST NODE DIRECTORY

--> that tells you more about each node, including the protocol used to talk
to that node

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #4
You can use the loopback technique to catalog the local instance and
database as a remote instance
and database.
1. Catalog the local instance as a remote node:
CATALOG TCPIP NODE node_name REMOTE hostname SERVER
port_number_or_service_name
2. Catalog the local database as a remote database:
CATALOG DB local_database_name AS alias_name_for_local_database AT NODE
node_name
HTH

"Knut Stolze" <st****@de.ibm.com> wrote in message
news:cc**********@fsuj29.rz.uni-jena.de...
Steffen wrote:
What is the better way to connect to the database (icp i assume)?
ipc oder TCP
IPC is faster but it requires that your client is on the same machine as
your server.
How can i catalog a Database as tcpip data source?


Have a look at the following DB2 commands:

CATALOG TCPIP NODE ...
CATALOG DATABASE ... AT NODE ...
and how can i find out how the database is currently cataloged ?


LIST DATABASE DIRECTORY

--> that tells you the node for each database and

LIST NODE DIRECTORY

--> that tells you more about each node, including the protocol used to

talk to that node

--
Knut Stolze
Information Integration
IBM Germany / University of Jena

Nov 12 '05 #5
Hi, thanks for your help so far

i am getting a connection now but:

I need to connect to 2 different databases on the same db2 instance.
However i can only get a connection to the first database. As soon
as i try to connect to the second database, (having the first
connection
still open) i get an exception.
I can connect to each of the databases separatly but not at the same
time
within one javaprogram.
The problem only occurs when i am locally on the aix machine where the
db2
instance resides. Running the program remotely from a windows machine
works
fine. Is it the IPC connction type the problem because it only works
for
one connection?

Thank you

Steffen

Exception:
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0119E Unexpected
system failure. SQLSTATE=58004
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_S QLException(SQLExceptionGenerator.java(Compiled
Code))
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_r eturn_code(SQLExceptionGenerator.java(Compiled
Code))
at COM.ibm.db2.jdbc.app.DB2Connection.connect(DB2Conn ection.java(Compiled
Code))
at COM.ibm.db2.jdbc.app.DB2Connection.<init>(DB2Conne ction.java:388)
at COM.ibm.db2.jdbc.app.DB2ReusableConnection.<init>( DB2ReusableConnection.java:69)
at COM.ibm.db2.jdbc.DB2PooledConnection.getConnection (DB2PooledConnection.java:188)
at COM.ibm.db2.jdbc.DB2XAConnection.<init>(DB2XAConne ction.java:98)
at COM.ibm.db2.jdbc.DB2XADataSource.getXAConnection(D B2XADataSource.java:101)
at COM.ibm.db2.jdbc.DB2XADataSource.getXAConnection(D B2XADataSource.java:68)
at de.bgnet.pada.ssp.testing.TestDB2Connection.main(T estDB2Connection.java:42)
javacode:
DB2XADataSource sourceAda = new DB2XADataSource();
sourceAda.setDatabaseName("ADABG22");
sourceAda.setPassword("***");
sourceAda.setUser("adatest");

DB2XADataSource sourceTass = new DB2XADataSource();
sourceTass.setDatabaseName("TASSDEV");
sourceTass.setPassword("***");
sourceTass.setUser("adatest");

XAConnection adaXAConnection = sourceAda.getXAConnection();
Connection connectionAda = adaXAConnection.getConnection();
System.out.println("connection ADA=" + connectionAda);

XAConnection xaTASSconnection = sourceTass.getXAConnection();
Connection connectionTass = xaTASSconnection.getConnection();
System.out.println("connection TASS=" + connectionTass);
gl*****@gmx.net (Steffen) wrote in message news:<f7*************************@posting.google.c om>...
hi there,

i have a problem connecting to a db2 database 7.2.4 on AIX using java
when running the javacode on AIX using jdk1.3.1.
The classpath is correctly set to java12/...

on windows the following code works fine for the same database:

DB2XADataSource db2 = new DB2XADataSource();
db2.setDatabaseName("MYDB");
db2.setPassword("test1");
db2.setUser("test1");
xaconnection = db2.getXAConnection();
connection = xaconnection.getConnection();

the database MYDB is configured in the client configuration assistant
on the windows machine

on the AIX machine xaconnection.getConnection() returns null
not even an exception is thrown
i cant figure out why that happens. I tried to set additional
properties
on the DB2XADataSource object, like port and servername, but I still
cant get a connection.

Does anybody know how to get the connection or
how to get more error or trace information.

Thank you.

Steffen

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JShurmatz | last post by:
If anyone can shed some light on this problem I would greatly appreciate it. I am unsuccessfully trying to use a database connnection retrieved from a pool configured using Java System Web...
0
by: Nils Valentin | last post by:
Hi MySQL Fans ;-), Is it possible that the 3.08 series allows to connect to 4.0.14 versions but not to the 4.1 alpha-versions ? I get belows error when tryig to connect from DbVisualizer which...
0
by: sridhar nagabhurshana | last post by:
hello I am trying to connect to mysql database using connector/J jdbc driver this is my code import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;
0
by: Robert Mazur | last post by:
MySQL 5.0 alpha (binary install) on Solaris 9 -or- RedHat 8.0 mysql-connector-java-3.0.8-stable ----------------------- Is there something different going on with JDBC and the alpha version...
4
by: Dani | last post by:
Hi everyone Description of the problem: Using a PreparedStatement to write down an integer (int) plus a timestamp for testing purposes. When read out again the integer looks very different. We...
5
oll3i
by: oll3i | last post by:
my librarybean package library.ejb; import java.sql.*; import javax.ejb.*; import library.common.*; @Stateless @Remote
2
by: bevis | last post by:
I'm new to sql server and mysql but this seems like it should be a pretty straight forward jdbc connection. But I have spent almost 2 days just trying to get a jdbc connection. Please help if you...
1
by: rjha94 | last post by:
Hi Folks we have a java application using hibernate ORM mapper on top of db2 UDB v9. we are using type 4 jdbc drivers for connections. Now the issue is we have a table with BLOB column and ...
3
by: Anoop | last post by:
Is it true that there are no type 4 jdbc drivers to connect to a DB2 server v7.1? The DB2 server is hosted on ACF2 (OS/390). We would be connecting from windows and solaris boxes. If it is true,...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.