org.postgresql.Driver - Mailing list pgsql-novice

From Bernardo López
Subject org.postgresql.Driver
Date
Msg-id 3ba0be70511171851u5c0b387emedbf4e45f22b64fa@mail.gmail.com
Whole thread Raw
Responses Re: org.postgresql.Driver  ("Announce" <truthhurts@insightbb.com>)
List pgsql-novice
Greetings!
I am starting to learn Java, and starting to use PostGreSQL too.
I need some major help here.
I am working under Windows XP Home Edition, and working with:

PostgreSQL 8.0.
pgAdmin III, v. 1.2.2.
jdk1.5.0_04.
JCreator 3.50 LE.

I am trying to run this example:

// File Connect.java
// Code starts here.
import java.sql.*;
public class Connect {
  public static void main(String[] args) {
    Connection cnn;
    try {
    Class.forName("org.postgresql.Driver");
    cnn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/","postgres","");
    Statement stmt = cnn.createStatement();
    int login=1;
    ResultSet rs = stmt.executeQuery("select * from usuarios");
    if (rs!=null) {
        while (rs.next()) {
            System.out.println(rs.getString("login"));
            System.out.println(rs.getString("password"));
            System.out.println(rs.getString("nombre"));
        }
    }
          rs.close();
        stmt.close();
        cnn.close();
    } catch (Exception e) {
    System.out.println(e);
    }

  }
}
// Code ends here.

But I keep getting the error message:

java.lang.ClassNotFoundException: org.postgresql.Driver

I've read a couple of related messages in this and other forums, but
nothing yet.
After many attempts, my PATH, CLASSPATH and other environment
variables are set like this:

- - - -
PATH
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%JAVA_HOME%\bin
- - - -
JAVA_HOME
C:\Archivos de programa\Java\jdk1.5.0_04
- - - -
CLASSPATH
%JAVA_HOME%\jre\lib;"C:\Archivos de
programa\PostgreSQL\8.0\jdbc\postgresql-8.0-311.jdbc2.jar";"C:\Archivos
de programa\PostgreSQL\8.0\jdbc\postgresql-8.0-311.jdbc2ee.jar";"C:\Archivos
de programa\PostgreSQL\8.0\jdbc\postgresql-8.0-311.jdbc3.jar"
- - - -
QTJAVA
"C:\Archivos de programa\Java\jre1.5.0_04\QTJava.zip"
- - - -

All help will be appreciated!

Keep posting!

pgsql-novice by date:

Previous
From: "Obe, Regina DND\\MIS"
Date:
Subject: Re: Application using PostgreSQL (off topic, but relevan
Next
From: Bernardo López
Date:
Subject: Re: org.postgresql.Driver