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 20030927102343.A3974@bacon
Whole thread Raw
In response to Tomcat - PostgreSQL - Cannot load JDBC driver class "null"  ("CRAIG GOLBY" <craig@golby.me.uk>)
Responses Re: Tomcat - PostgreSQL - Cannot load JDBC driver class "null"
List pgsql-jdbc
On 26/09/2003 17:29 CRAIG GOLBY wrote:
> [snip]
>   public void init() {
>     try{
>       Context ctx = new InitialContext();
>       if(ctx == null )
>           throw new Exception("Boom - No Context");
>       status = "checking CTX";
>
>       DataSource ds =
> (DataSource)ctx.lookup("java:comp/env/jdbc/PersonalDb");
>       status = "Completing Lookup of CTX";
>
>       if (ds != null)
>         {
>          status = "Creating Connection";
>          Connection conn = ds.getConnection();   <----- FAILS HERE

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.

HTH

--
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: Barry Lind
Date:
Subject: Re: problem with setting boolean value on AbstractJdbc1Statement
Next
From: Bruce Momjian
Date:
Subject: Re: Statement.cancel() may cancel queries in the future