aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Accessing DataSource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Accessing DataSource" Watch "Accessing DataSource" New topic
Author

Accessing DataSource

leela kali
Greenhorn

Joined: Feb 12, 2004
Posts: 3
Hi
I want to access JNDI DataSource created in WebSphere through a java program/client. This java file does not exist in the same classloader and sits outside the class loader(classloader - where webshpere running). How do I access the DataSource in WebSphere? Help is really appreciated.
Thanks
Leela.
[ February 12, 2004: Message edited by: leela kali ]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
First of all, if you're going to use WebSphere, I'd strongly suggest taking a look at IBM Redbooks | WebSphere -- there's a lot of useful handbooks teaching to use the WebSphere tools.
As to your question about accessing the DataSource from a standalone client, the difference from the regular situation (servlet accessing a DataSource within the same server instance) is in how you obtain an InitialContext for the JNDI tree.
Here's how you need to do it in a standalone client:


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
leela kali
Greenhorn

Joined: Feb 12, 2004
Posts: 3
Hi Lasse,
Thanks for your immediate response. What security credentials I need to pass to the hash table. I am accessing Data Source through pure stand alone java client not a servlet.
Help is really appreciated and thanks for sparing your time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing DataSource
 
Similar Threads
Remote JNDI Look up
Probelm in connection pool
Access Datasouce in java main method
classloader
How to access DataSource in Java Files