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 по дате отправления: