DataSource Question

Jack Lauman <[email protected]> Sun, 29 Aug 2004 14:22:31 -0700
Newsgroups gmane.comp.java.sun.servlet
Organization nwcascades.com
Message-ID <[email protected]>
I'm using the following code in a servlet to get a JDBC connection:

Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/DBNameDS");
Connection conn = ds.getConnection();

It works fine... but I would like to be able to substitute "DBNameDS"
with the actual name of the ds as defined in the web.xml file.

How can this be done?

Jack

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html