jdbc example: java.lang.NoClassDefFoundError - Mailing list pgsql-jdbc

From Neil Zanella
Subject jdbc example: java.lang.NoClassDefFoundError
Date
Msg-id Pine.LNX.4.30.0111020023010.4242-100000@garfield.cs.mun.ca
Whole thread Raw
Responses Re: jdbc example: java.lang.NoClassDefFoundError  ("Dave Cramer" <Dave@micro-automation.net>)
Re: jdbc example: java.lang.NoClassDefFoundError  ("Nick Fankhauser" <nickf@ontko.com>)
Re: jdbc example: java.lang.NoClassDefFoundError  ("Nick Fankhauser" <nickf@ontko.com>)
List pgsql-jdbc
Hello,

I have been trying to access the postgresql mailing list archives online
but the archives.postgresql.org server as well as a bunch of other
postgresql servers appear to be down and the lists are not (yet)
archived at <http://www.mail-archive.com/lists.html>.

The problem I am experiencing is I have Red Hat 7.1 installed with the
postgresql 7.0 stuff including postgresql-jdbc. I have set my CLASSPATH
to point to /usr/lib/pgsql/jdbc7.0-1.2.jar and have also installed JDK
1.3.1 and updated the PATH variable accordingly. However I am getting
the following error when trying to access a simple postgresql databse.
Any ideas of what might have gone wrong?

Exception in thread "main" java.lang.NoClassDefFoundError: TestPostgreSQL

Thanks,

Neil

sample code generating the error:

import java.sql.*;

class TestPostgreSQL {
  public static void main(String arg[]) throws SQLException,
ClassNotFoundException {

    String db_driver = "org.postgresql.Driver";
    String db_site = "jdbc:postgresql:joedb";
    String db_user = "joe";
    String db_pass = "doe";

    Class.forName(db_driver);
    Connection connection = DriverManager.getConnection(db_site, db_user,
db_pass);
    Statement statement = connection.createStatement();
    ResultSet resultset = statement.executeQuery("SELECT * FROM
joetable");
    System.out.println(resultset.getString("joe_column"));

  }
}




pgsql-jdbc by date:

Previous
From: "Shevland, Joseph (AU - Hobart)"
Date:
Subject: Re: New pooling (Long) [Was RE: Updates to the driver]
Next
From: Carlos Augusto
Date:
Subject: