Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / March 2005

Tip: Looking for answers? Try searching our database.

Binding to JNDI datasource - please help

Thread view: 
John Chambers - 21 Mar 2005 19:45 GMT
Hi all, I'm relatively new to JNDI concepts and need some help.  I am
writing a web app that accepts a variable specifying a jndi pooled
connection datasource as a url variable.  This is a requirement and
cannot be changed.  For example index.jsp?db=java:defaultdb

How do I use this JNDI name to create a connection?  All the
literature I have read says to bind the resource manager connection
factory reference (res-ref-name) to the (jndi-name) in the server
specific xml (assumes knowledge of jndi name beforehand).  Then do a
lookup on res-ref-name.  In this case I do not know on what server
this war will be deployed and want to bind directly to the datasource
defined by my url variable.  Can I do this without using a
res-ref-name and doing a lookup?

Your help is apprecitated,

John
Bryce - 23 Mar 2005 23:50 GMT
>Hi all, I'm relatively new to JNDI concepts and need some help.  I am
>writing a web app that accepts a variable specifying a jndi pooled
[quoted text clipped - 9 lines]
>defined by my url variable.  Can I do this without using a
>res-ref-name and doing a lookup?

No. In order to use a JNDI name, it must be defined on your server (or
whichever server you have setup to handle JNDI lookups). It must be
defined in your webapp's context as well as referenced in your web.xml
file. Otherwise, how does the server know w hat that JNDI name refers
to?

--
now with more cowbell


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.