Re: Help!Can't connect Postgresql JDBC driver

From: "George Johnson" <gjohnson(at)jdsc(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Help!Can't connect Postgresql JDBC driver
Date: 2000-12-13 23:27:05
Message-ID: 004401c0655c$34b8d960$0300a8c0@jdsc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I'm not sure if this helps, but for some reason,
Class.forName("postgresql.Driver") is listed but probably should be
Class.forName("org.postgresql.Driver") ... the driver is actually beneath
the org directory. I'm not familar with linux variants of the PostgreSQL
stuff. Sometimes when in doubt, unjar (jar -xvf) the jar files and look at
what's inside. That often times points to problems. Also, always remember
to include jar files in your classpath.

Is there a postgresql.jdbc or postgresql.java mailing list? This probably
belongs there ...

George Johnson

----- Original Message -----
From: "Cheung Yip San" <monitorc(at)netvigator(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Wednesday, December 13, 2000 7:48 AM
Subject: Help!Can't connect Postgresql JDBC driver

> Could anyone tell me how can I write the applet to connect the
> PostgreSQL?
>
>
> I have installed the Postgresql 7.0.3 RPM on RedHat 6.2 server and try
> to write the applet program to access the database. But the following
> error make me confuse :
>
> java.lang.ClassNotFoundException: java.io.FileNotFoundException:
> http://itdpc27b/~earnest/project/postgresql/Driver.class
>
> I have installed the PSQL 7.0.3 JDBC RPM on the server, I can't see the
> "postgresql.jar" but "jdbc7.0.1-1.jar", "jdbc7.0.1-2.jar".
>
>
> Also, I have tried to run this program from my own desktop PC and on the
> linux server locally, but both are encountered the same error.
>
>
> The following is my program (MyDB.java)
>
> import java.awt.*;
> import java.awt.event.*;
> import java.applet.*;
> import java.sql.*;
>
> public class MyDB extends Applet{
> Connection db;
>
> public void init(){
> try {
> Class.forName("postgresql.Driver");
> String urlStr="jdbc:postgresql://itdpc27b:5432/testdb";
> db=DriverManager.getConnection(urlStr, "earnest", "password");
> } catch (ClassNotFoundException e) {
> e.printStackTrace();
> return;
> }
> catch (SQLException es) {
> System.out.println("SQL Error");
> return;
> }
>
>
> try {
> Statement st = db.createStatement();
> ResultSet rs = st.executeQuery("select * from customer");
> while(rs.next()) {
> System.out.print("Column 1 returned ");
> System.out.println(rs.getString(1));
> }
> rs.close();
> st.close();
> } catch (SQLException es) {
> System.out.println("SQL Error");
> return;
> }
> }
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alfred Perlstein 2000-12-13 23:48:42 commit log search broken.
Previous Message Robert B. Easter 2000-12-13 23:25:36 Re: RI and restoring dumps