X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 25D91475CE5 for ; Mon, 14 Apr 2003 12:57:06 -0400 (EDT) Received: from lucifer.akyasociados.com.ar (unknown [200.69.203.237]) by postgresql.org (Postfix) with ESMTP id 59FF0475B8E for ; Mon, 14 Apr 2003 12:57:01 -0400 (EDT) Received: from taz.oficina (taz.oficina [192.168.1.197]) (authenticated bits=0) by lucifer.akyasociados.com.ar (8.12.8/8.12.8) with ESMTP id h3EGwOeS038933; Mon, 14 Apr 2003 13:58:24 -0300 (ART) (envelope-from franco@akyasociados.com.ar) From: Franco Bruno Borghesi Organization: AK y Asociados S.R.L. To: "Greg Lugering" , Subject: Re: JDBC Drivers for Java Date: Mon, 14 Apr 2003 13:56:11 -0300 User-Agent: KMail/1.5 References: <000801c30084$c5dd65d0$ef00a8c0@cfl.rr.com> In-Reply-To: <000801c30084$c5dd65d0$ef00a8c0@cfl.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_rgum+GZEviHA3tH"; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200304141356.11542.franco@akyasociados.com.ar> X-Spam-Status: No, hits=-38.8 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES,USER_AGENT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/218 X-Sequence-Number: 8373 --Boundary-02=_rgum+GZEviHA3tH Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: signed data Content-Disposition: inline Here is working example for you to try: --In my databse CREATE TABLE people ( id SERIAL, name TEXT ); INSERT INTO people(name) VALUES ('sue'); INSERT INTO people(name) VALUES ('peter'); INSERT INTO people(name) VALUES ('tony'); INSERT INTO people(name) VALUES ('mary'); =20 --ListPeople.java import java.sql.*; public class ListPeople { public static void main(String[] args) {=20=20=20 try { Class.forName("org.postgresql.Driver"); =20=20=20=20=20=20=20=20=20 //the url is=20 jdbc:postgresql://:/?user=3D&password=3D //in my case, the database is in localhost, and I need no password= s,=20 so using=20 //jdbc:postgresql:?user=3D will be just = fine Connection=20 con=3DDriverManager.getConnection("jdbc:postgresql:franco?user=3Dadmin"); Statement stmt=3Dcon.createStatement(); ResultSet rs=3Dstmt.executeQuery("SELECT * FROM people"); while (rs.next()) { System.out.println(rs.getString("name")); } } catch (Exception e) { System.out.println("Exception: "+e.getMessage()); } } } It works for me, so if doesn't work for you I'm sure the problem is in your= =20 CLASSPATH. On Friday 11 April 2003 20:47, Greg Lugering wrote: > I just installed the Windows version of PostgreSQL 7.3.1. > A jar file was included however the path was org/postgresql/Driver which > causes and exception. I expected somethig like org.postgresql.Driver. > > If anyone can help me and send the exact code for making the connection it > woud be appreciated. > > Thanks! > > Bob Lugering > blugering@cfl.rr.com --Boundary-02=_rgum+GZEviHA3tH Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQA+mugrz/PwDAvtu7oRArbqAJ4lmzIXVNYAzkgfiTKcJTDz3PzKTgCfWype vFO+zKrolMsu00/5e+Sbfg8= =6Izn -----END PGP SIGNATURE----- --Boundary-02=_rgum+GZEviHA3tH--