473,396 Members | 1,748 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,396 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 5611
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.