--- On Mon, 12/1/08, Oliver Jowett <oliver@opencloud.com> wrote:
> I suggest you post your whole testcase to the list,
> it's too hard to guess at exactly what you're doing
> otherwise.
import java.sql.*;
public class TestPlatingShop {
public static void main(String[] arguments) {
String data = "jdbc:postgresql://192.168.1.199/platingshop";
try {
// call to Class.forName no longer necessary
Class.forName("org.postgresql.Driver");
Connection conn = DriverManager.getConnection(
data, "", "");
Statement st = conn.createStatement();
ResultSet rec = st.executeQuery(
"SELECT custname " +
"FROM customers " +
"WHERE " +
"(acctnum = 'B20109')");
System.out.println("Customer Name");
while(rec.next()) {
System.out.println(rec.getString(1));
}
st.close();
} catch (SQLException s) {
System.out.println("SQL Error: " + s.toString() + " "
+ s.getErrorCode() + " " + s.getSQLState());
} catch (Exception e) {
System.out.println("Error: " + e.toString()
+ e.getMessage());
}
}
}
This returns "Error: java.lang.ClassNotFoundException: org.postgresql.Driverorg.postgresql.Driver" when run.
Bruce