Re: Tomcat - PostgreSQL - Cannot load JDBC driver class "null" - Mailing list pgsql-jdbc

From Paul Thomas
Subject Re: Tomcat - PostgreSQL - Cannot load JDBC driver class "null"
Date
Msg-id 20030929085303.A18236@bacon
Whole thread Raw
In response to Re: Tomcat - PostgreSQL - Cannot load JDBC driver class "null"  (Paul Thomas <paul@tmsl.demon.co.uk>)
List pgsql-jdbc
On 27/09/2003 10:23 Paul Thomas wrote:
>
> With a NullPointerException I presume? Try
>
>       DataSource ds =
> (DataSource)ctx.lookupLink("java:comp/env/jdbc/PersonalDb");
>
> And rememeber that the JDBC driver _must_ be in common/lib and _must
> not_ be in the classpath.

Whoops! Actually looking at source code instead relying on memory, that
should be something like

        InitialContext cxt = new InitialContext();
        Context ctx2 = (Context)ctx.lookup("java:comp/env");
        DataSource ds = (DataSource)ctx2.lookupLink("jdbc/PersonalDb");

Which is the only way I could find which worked on Tomcat 4.1.12. I've
just retried this on 4.1.24

        InitialContext cxt = new InitialContext();
        DataSource ds =
(DataSource)ctx.lookup("java:comp/env/jdbc/PersonalDb");

and that works too so whatever the problem was on the older version seems
to have been fixed.

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants         |
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+

pgsql-jdbc by date:

Previous
From: ""
Date:
Subject: Re: Tomcat - PostgreSQL - Perfomance Tuning
Next
From: Marco Vezzoli
Date:
Subject: Re: Pgsql 7.3 JVM 1.1 driver missing