tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Lauman <jlau...@nwcascades.com>
Subject DataSource Question
Date Sun, 29 Aug 2004 21:29:22 GMT
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, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message