Thread: JDBC postgresql.Driver

JDBC postgresql.Driver

From
David Giffin
Date:
Hello,

I'm trying out an O'Reilly java example on my Windows95 machine. I have
downloaded the precompiled version of postgresql.jar. But for some reason
the the complier doesn't recongize that the postgresql driver is there.

---
C:\WINDOWS\DESKTOP>javac -classpath c:\windows\desktop\postgresql.jar
ExecuteSQL
.java
ExecuteSQL.java:33: Undefined variable or class name: postgresql
  Class.forName(postgresql.Driver);
                ^
1 error
---

or where I complie woth out specificing the driver I get this:

---
C:\WINDOWS\DESKTOP>java ExecuteSQL -d postgresql.Driver
jdbc:postgresql://beta.pen.k12.or.us/os98

java.lang.ClassNotFoundException: postgresql.Driver
Usage: java ExecuteSQL [-d <driver>] [-u <user>] [-p <password>] <database URL>
---

Should I being calling the driver by a different name? I'm not sure what
is going on here?

David







Re: [INTERFACES] JDBC postgresql.Driver

From
Peter T Mount
Date:
On Wed, 20 Jan 1999, David Giffin wrote:

>
> Hello,
>
> I'm trying out an O'Reilly java example on my Windows95 machine. I have
> downloaded the precompiled version of postgresql.jar. But for some reason
> the the complier doesn't recongize that the postgresql driver is there.
>
> ---
> C:\WINDOWS\DESKTOP>javac -classpath c:\windows\desktop\postgresql.jar
> ExecuteSQL
> .java
> ExecuteSQL.java:33: Undefined variable or class name: postgresql
>   Class.forName(postgresql.Driver);
>                 ^

You missed out the quotes:

>   Class.forName("postgresql.Driver");

> Should I being calling the driver by a different name? I'm not sure what
> is going on here?

Just the quotes are missing. It should work fine from there.

Peter

--
Peter Mount, IT Section
petermount@it.maidstone.gov.uk
Anything I write here are my own views, and cannot be taken as being the
official words of Maidstone Borough Council