Still having trouble getting JDBC working - Mailing list pgsql-jdbc

From Corey Mosher
Subject Still having trouble getting JDBC working
Date
Msg-id Pine.BSF.4.21.0104191550160.4991-100000@wired.hub.org
Whole thread Raw
Responses Re: Still having trouble getting JDBC working  (jlemcke@netspace.net.au)
List pgsql-jdbc
Hi
  Can anyone help me with this problem?  I have jdk1.2.2 installed on
a freeBSD system.  My class path in .cshrc is as follows:

set CLASSPATH = (/usr/local/lib/postgresql.jar)

I get this error:

Exception caught.
java.lang.ClassNotFoundException: org.postgresql.Driver
Exception caught.
java.sql.SQLException: No suitable driver
Ok

When running the following code (I replaced all the connection stuff with x's for privacy reasons):

import java.io.*;
import java.sql.*;
import java.util.*;

public class test{

  public static void main(String args[]){
    Connection  conn;         // holds database connection
    Properties prop = new Properties();
    prop.put("jdbc.drivers", "org.postgresql.Driver");
    System.setProperties(prop);
    try {
      Class.forName("org.postgresql.Driver");         // load database interface
    } catch(Exception exc){
        System.err.println("Exception caught.\n" + exc);
      }
    try {
    conn = DriverManager.getConnection("jdbc:postgresql://xxxxxxxx:5432/xxxxx", "xxxxx", "xxxxxx");
    } catch(Exception exc){
        System.err.println("Exception caught.\n" + exc);
      }
    System.out.println("Ok");
    //conn.close();
  }                                                                                             }

Does the postgresql.jar file need any special permissions?  Right now I have:

-rw-r--r--  1 root  wheel  153145 Apr 16 08:53 /usr/local/lib/postgresql.jar

Any ideas?

Thanks.

Corey Mosher

-----------------------------
Hub.Org Networking Services
251 Main St.
Wolfville, NS
Canada
B0P 1X0
Email: corey@hub.org
Phone: (902) 542-3657
-----------------------------
PostgreSQL, Inc.
251 Main St.
Wolfville, NS
Canada
B0P 1X0
Email: corey@pgsql.com
Phone: (902) 542-0713
-----------------------------
Fax:   (902) 542-5386


pgsql-jdbc by date:

Previous
From: Joe Shevland
Date:
Subject: RE: Failed Connection?
Next
From: Hunter Hillegas
Date:
Subject: A Bug Fix - Is this a real bug? Has this already been fixed?