aspose file tools*
The moose likes Websphere and the fly likes Getting database connection failed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Getting database connection failed" Watch "Getting database connection failed" New topic
Author

Getting database connection failed

Hritika Sheren
Greenhorn

Joined: Aug 17, 2004
Posts: 2
Environment :
1) WSAD 5.1
2) EJB
3) A client application

My data connection code in EJB container is like
DataSourceFactory dsFactory = DataSourceFactory.getSingleton();
if (dataSource == null || dbUserName == null || dbPassword == null
|| dbViewSchema == null || dbTableSchema == null)
throw new Exception(" No db user id and password or schema name specified");
DataSource ds = dsFactory.lookupHome("jdbc/" + dataSource);
if(ds!=null){
dbCon = ds.getConnection(dbUserName,dbPassword);
}

This works fine when accessed from within EJB container, but when I try to use the same connection from standalone java program, it give me following exception at line
dbCon = ds.getConnection(dbUserName,dbPassword)

com.ibm.ejs.jts.jts.CurrentSet$InitializationError: not initialized

Immediate help will be really appreciated.

Thanks in advance.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

Hritika,
I'm moving this to our Websphere forum. You could have posted this in IDEs or Websphere, but I think you'll get a better answer there.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

Hritika,
Is this being run as a java application or as an application client?
Hritika Sheren
Greenhorn

Joined: Aug 17, 2004
Posts: 2
Hi Jeanne,
It is a java application. A standalone java application is calling a method which uses connection from connection pool which is maintained by EJB container.
I got the solution for this. This was problem with WAS 5.0 release and a fix pack for this was already released. In our setup, we installed Fix Pack 1 over WAS 5.1 installation and it solved the problem.
This problem is fixed by APAR PQ78401.

Thanks anyway Jeanne for forwarding a helping hand.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting database connection failed
 
Similar Threads
PLEASE HELP !!! WEBSPHERE CONNECTION POOLING PART II
Can I use EJBQL for BMP?
DSN name not found error with TOMCAT5.5.7
DB Managed Connection
DataSource lookup by a client java program fails