From: | "Andy Engdahl" <andy(at)crophailmanagement(dot)com> |
---|---|
To: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | PostgreSQL JDBC |
Date: | 2001-02-23 16:58:45 |
Message-ID: | 001101c09db9$e257f660$1964a8c0@crophailmanagement.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I seem to be having some problems w/ the psql jdbc driver. I'm able to load the driver, but as soon as I try to connect w/ the database. here's my code:
import java.sql.*;
public class dataBase {
public static void main(String [] args){
try {
Class.forName("org.postgresql.DriverClass").newInstance();
System.out.println("Driver Loaded Successfully");
} catch (Exception e) {
System.out.println("Unable to Load Driver " + e.getMessage() );
}
try {
Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost/mapping",
"mapping", "");
} catch (SQLException e) {
System.out.println("SQLException: " + e.getMessage());
}
}
}
When I run this code as shown, I get the following output:
Driver Loaded Successfully
SQLException: No suitable driver
I'm trying to connect to the database "mapping" under the user "mapping" w/ no password. Does anybody know what I'm doing wrong? I'm running psql ver 7.0.2 and jdbc driver "jdbc7.0-1.2.jar" and the java 1.3 jdk. Any comments or suggestions would be greatly appreciated. thanks.
From | Date | Subject | |
---|---|---|---|
Next Message | pgsql-bugs | 2001-02-23 17:18:15 | Date calculation produces wrong output with 7.02 |
Previous Message | Tom Lane | 2001-02-23 16:42:22 | Re: [HACKERS] Re: v7.1b4 bad performance |