axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark A. Richman" <>
Subject Using JNDI from Web Service
Date Wed, 26 Dec 2001 14:57:02 GMT
Hi all!!!
Is it possible to reference a JNDI object from a web service's
implementation class? For example, I have a class I wish to expose as a
web service. This class is currently accessing a HypersonicSQL
DataSource using the usual "Class.forName("org.hsqldb.jdbcDriver")" and
associated DriverManager.getConnection() contructs.
How can I define a JDBC DataSource using JNDI and gain access to it from
my web service implementation?
Presumably, I'd want to replace all the prior code with something like
InitialContext ctx = new InitialContext();
DataSource ds =
Connection con = ds.getConnection();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(sql);
Mark A. Richman <> 

View raw message