aspose file tools*
The moose likes JDBC and the fly likes JNDI lookup in standalone jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JNDI lookup in standalone jar file" Watch "JNDI lookup in standalone jar file" New topic
Author

JNDI lookup in standalone jar file

paresh doshi
Ranch Hand

Joined: Nov 20, 2006
Posts: 81
Hi,

I have a standalone jar file which makes a DB connection. Can i use JNDI lookup for connection as we do in web applications ?

If we can use can anyone provide the sample code. Also provide information on how to setup the jndi name.

Thanks in Advance


Thanks.<br />Paresh Doshi<br />SCJP 1.4
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

If the DataSource is setup as a resource (in the app or on the server) then yes.


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI lookup in standalone jar file