Still not right.  You should be looking up something like this:

java:comp/env/jdbc/DBPool

and then mapping that to a jndi reference in your deployment descriptors.

----- Original Message -----
From: "Kobi Schecider" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 30, 2001 2:28 AM
Subject: Re: [JBoss-user] Problem with stateless session bean BMP on
Postgresql 7.1.1, JBoss 2.2.1


> Thanks, Dan. I switched to jndi and everything works fine. The new code
> looks like:
>
> InitialContext ctx = new InitialContext();
> DataSource ds = (DataSource) ctx.lookup("java:/DBPool");
> Connection conn = ds.getConnection();
> // do the db work.
>
> Kobi
>
>
> >From: "danch (Dan Christopherson)" <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: [EMAIL PROTECTED]
> >Subject: Re: [JBoss-user] Problem with stateless session bean BMP on
> >Postgresql 7.1.1, JBoss 2.2.1
> >Date: Tue, 29 May 2001 11:15:46 -0500
> >
> >Kobi Schecider wrote:
> >
> >
> >>            conn = DriverManager.getConnection(
> >>                    "jdbc:postgresql://myhost/mydb", "id", "pwd");
> >
> >
> >don't do that! Get the connection by looking up a DataSource from JNDI.
> >There are a lot of examples of how to do this out on the web and in
print.
> >
> ><< InterScan_Disclaimer.txt >>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to