File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes WebSphere - DB2 DataSource Connection Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "WebSphere - DB2 DataSource Connection Problem" Watch "WebSphere - DB2 DataSource Connection Problem" New topic

WebSphere - DB2 DataSource Connection Problem

Jaime Garcia
Ranch Hand

Joined: Jan 07, 2003
Posts: 38
I am using DB2 7.1 and WebSphere 4.0.3. (OS Solaris 5.8) I access DB2 Data Bases with Implementation class for Pool Connection (Data source). I need to access 6 diferent data bases. It works fine at the begining but sudenly It dose not get connections from pool. This is the error from WebSphere Pool:
CONM6009E: Failed to get connection to the database from datasource (DB)

I am sure that I close all connections.
Any Idea ?.
The same code (none change) works in Tomcat 4.0.6 (the data source that it use is from tyrex I guess) and DB2 for Windows 7.1.
I have the license of DB2 for Windows but from Sun is a Trial version.
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
The very fact you say you're using pool data source worries me. Can you post the code you're using?

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Jaime Garcia
Ranch Hand

Joined: Jan 07, 2003
Posts: 38
This is the code that I use to obtain the connection:
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
//db is the name of the DataBase
DataSource ds = (DataSource) envCtx.lookup(db);
conn = ds.getConnection();
I have already try this one:
java.util.Properties parms = new java.util.Properties();

javax.naming.Context envCtx = new javax.naming.InitialContext(parms);
DataSource ds = (DataSource) envCtx.lookup("java:comp/env/"+db);
conn = ds.getConnection();
I agree. Here's the link:
subject: WebSphere - DB2 DataSource Connection Problem
It's not a secret anymore!