Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 13665 invoked by uid 500); 26 Dec 2001 14:55:16 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 13656 invoked from network); 26 Dec 2001 14:55:16 -0000 X-Sent: 26 Dec 2001 14:55:07 GMT Reply-To: From: "Mark A. Richman" To: , Subject: Using JNDI from Web Service Date: Wed, 26 Dec 2001 09:57:02 -0500 Message-ID: <002d01c18e1d$96afbd60$6801a8c0@yoda> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002E_01C18DF3.ADDB3C00" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_002E_01C18DF3.ADDB3C00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 this: InitialContext ctx = new InitialContext(); DataSource ds = (javax.sql.DataSource)ctx.lookup("java:comp/env/jdbc/MyDataSource"); Connection con = ds.getConnection(); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(sql); Thanks, Mark A. Richman http://www.markrichman.com ------=_NextPart_000_002E_01C18DF3.ADDB3C00 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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 this:

 

InitialCo= ntext ctx =3D new InitialContext();

DataSourc= e ds =3D (javax.sql.DataSource)ctx.lookup("java:comp/env/jdbc/MyDataSource");<= /span>

Connection con =3D ds.getConnection();

Statement stmt =3D con.createStatement();

ResultSet= rs =3D stmt.executeQuery(sql);

 =

 =

Thanks,<= /font>

Mark A. = Richman

http://www.markrichman.com<= /o:p>

 =

 

------=_NextPart_000_002E_01C18DF3.ADDB3C00--