Re: Tomcat - PostgreSQL - Cannot load JDBC driver class "null"

Поиск
Список
Период
Сортировка
От Paul Thomas
Тема Re: Tomcat - PostgreSQL - Cannot load JDBC driver class "null"
Дата
Msg-id 20030927102343.A3974@bacon
обсуждение исходный текст
Ответ на Tomcat - PostgreSQL - Cannot load JDBC driver class "null"  ("CRAIG GOLBY" <craig@golby.me.uk>)
Ответы Re: Tomcat - PostgreSQL - Cannot load JDBC driver class "null"
Список 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 по дате отправления:

Предыдущее
От: Barry Lind
Дата:
Сообщение: Re: problem with setting boolean value on AbstractJdbc1Statement
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Statement.cancel() may cancel queries in the future