X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5549CD1B25F for ; Sun, 11 Jul 2004 17:32:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 54066-04 for ; Sun, 11 Jul 2004 20:31:58 +0000 (GMT) Received: from pd5mo2so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by svr1.postgresql.org (Postfix) with ESMTP id B16CBD1B248 for ; Sun, 11 Jul 2004 17:31:55 -0300 (ADT) Received: from pd4mr3so.prod.shaw.ca (pd4mr3so-qfe3.prod.shaw.ca [10.0.141.214]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003)) with ESMTP id <0I0P006XAFG97Q@l-daemon> for pgsql-jdbc@postgresql.org; Sun, 11 Jul 2004 14:26:33 -0600 (MDT) Received: from pn2ml3so.prod.shaw.ca ([10.0.121.147]) by pd4mr3so.prod.shaw.ca (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0I0P00M86FG9R700@pd4mr3so.prod.shaw.ca> for pgsql-jdbc@postgresql.org; Sun, 11 Jul 2004 14:26:33 -0600 (MDT) Received: from numbertwo (S0106000625968011.gv.shawcable.net [24.109.95.90]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003)) with SMTP id <0I0P00C1YFG82R@l-daemon> for pgsql-jdbc@postgresql.org; Sun, 11 Jul 2004 14:26:33 -0600 (MDT) Date: Sun, 11 Jul 2004 13:26:31 -0700 From: Eric Wright Subject: JDBC Connection To: pgsql-jdbc@postgresql.org Message-id: <001c01c46785$5a943470$6601a8c0@numbertwo> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Mailer: Microsoft Outlook Express 6.00.2800.1409 Content-type: multipart/alternative; boundary="----=_NextPart_000_0019_01C4674A.ADFFF490" X-Priority: 3 X-MSMail-priority: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.8 tagged_above=0.0 required=5.0 tests=FAKE_HELO_SHAW_CA, HTML_30_40, HTML_MESSAGE, RCVD_IN_SORBS X-Spam-Level: * X-Archive-Number: 200407/98 X-Sequence-Number: 10482 This is a multi-part message in MIME format. ------=_NextPart_000_0019_01C4674A.ADFFF490 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello,=20 I am having some trouble connecting to my postgres database.=20 I have started off with a simple test class to make and test a connection. = When I run the simple tester I am getting the following output: The connection failed. java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:532) at java.sql.DriverManager.getConnection(DriverManager.java:171) at app.dao.ConnectionTest.main(ConnectionTest.java:28) =46rom the following test class: package app.dao; import java.sql.*; public class ConnectionTest { public static void main(String[] args) { String url =3D "jdbc:postgres://192.168.1.101/asset"; String user =3D "asset$admin"; String pwd =3D "password"; try { Class.forName("org.postgresql.Driver"); Connection con =3D DriverManager.getConnection(url, user, pwd); if(!con.isClosed()){ System.out.println("The connection succeeded"); con.close(); } }catch(Exception e){ e.printStackTrace(); System.out.println("The connection failed."); }=20 } } I have read the information at http://www.fankhausers.com/postgresql/jdbc/#= nosuitabledriver I am using Eclipse 3.0 and trying it run it in the debugger. I am using postgresql 7.4, JDK 1.4, and pg74.214.jdbc3.jar Any help that you can provide would be great.=20 Thanks Eric W ------=_NextPart_000_0019_01C4674A.ADFFF490 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
 
I am having some trouble connecting to my = postgres=20 database.
I have started off with a s= imple=20 test class to make and test a connection. When I run the simple tester= I am=20 getting the following output:
 
    The connection=20 failed.
    java.sql.SQLException: No suitable=20 driver
     at=20 java.sql.DriverManager.getConnection(DriverManager.java:532)
  = ; =20  at=20 java.sql.DriverManager.getConnection(DriverManager.java:171)
  = ; =20  at app.dao.ConnectionTest.main(ConnectionTest.java:28)
 
From the following test class:
 
package app.dao;
import java.sql.*;
 
public class ConnectionTest {
 pub= lic=20 static void main(String[] args) {
  String url  &nbs= p; =3D=20 "jdbc:postgres://192.168.1.101/asset";
  String user &nbs= p; =3D=20 "asset$admin";
  String pwd    =3D=20 "password";
  try=20 {
   Class.forName("org.postgresql.Driver");
 &nb= sp; Connection=20 con =3D DriverManager.getConnection(url, user,=20 pwd);
   if(!con.isClosed()){
    = System.out.println("The=20 connection=20 succeeded");
    con.close();
   }=
  }catch(Exception=20 e){
   e.printStackTrace();
   System.o= ut.println("The=20 connection failed.");
  }
 }
}
 
I have read the information at http:= //www.fankhausers.com/postgresql/jdbc/#nosuitabledriver
I am using Eclipse 3.0 and trying it = run it in=20 the debugger.
I am using postgresql 7.4, JDK 1.4, and=20 pg74.214.jdbc3.jar
 
Any help that you can provide would = be great.=20
 
Thanks Eric=20 W
------=_NextPart_000_0019_01C4674A.ADFFF490--