File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting database connection failed

 
Hritika Sheren
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 33697
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33697
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hritika,
Is this being run as a java application or as an application client?
 
Hritika Sheren
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic