Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C881A6359E0 for ; Tue, 9 Mar 2010 13:30:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 42036-04 for ; Tue, 9 Mar 2010 17:30:11 +0000 (UTC) X-Greylist: delayed 00:07:18.024752 by SQLgrey-1.7.6 Received: from mail-qy0-f178.google.com (mail-qy0-f178.google.com [209.85.221.178]) by mail.postgresql.org (Postfix) with ESMTP id 12D466359C9 for ; Tue, 9 Mar 2010 13:30:12 -0400 (AST) Received: by qyk8 with SMTP id 8so5219895qyk.4 for ; Tue, 09 Mar 2010 09:30:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.71.197 with SMTP id i5mr12478qaj.381.1268155367042; Tue, 09 Mar 2010 09:22:47 -0800 (PST) In-Reply-To: <4B967DB4.8090104@ttc-cmc.net> References: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com> <4B967DB4.8090104@ttc-cmc.net> Date: Tue, 9 Mar 2010 09:22:46 -0800 Message-ID: <895e58dd1003090922k54e67f44k94f1903a72b5879f@mail.gmail.com> Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed From: Maciek Sakrejda To: dmp Cc: Major Services , pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.602 tagged_above=-10 required=5 tests=AWL=-0.862, BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 201003/24 X-Sequence-Number: 20364 I don't imagine Class.forName() would throw a PSQLException. If I'm reading the ConnectionFactoryImpl code correctly, the server seems to be responding to the Startup message with something that is neither an error nor an authentication request, which seems weird. Can you use Wireshark or tcpdump to look at traffic on the wire? --- Maciek Sakrejda | Software Engineer | Truviso 1065 E. Hillsdale Blvd., Suite 230 Foster City, CA 94404 (650) 242-3500 Main (650) 242-3516 T (510) 717-5398 M (650) 242-3501 F msakrejda@truviso.com www.truviso.com On Tue, Mar 9, 2010 at 8:56 AM, dmp wrote: > Did not look up error, but looks like the Class.forName(). > Attached standard main() to create a connection to PostgreSQL. > > danap. > > > =A0 //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =A0 // Main public access point method for instantiating the > =A0 // PostgreSQL_JDBC application. Arguments: database, username, > =A0 // & password. > =A0 // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =A0 public static void main(String[] args) throws SQLException, > InstantiationException, > =A0 =A0 =A0 =A0 IllegalAccessException, ClassNotFoundException, Interrupt= edException > =A0 { > =A0 =A0 =A0String host, database, username, password; > =A0 =A0 =A0Connection dbConnection; > > =A0 =A0 =A0// Collect connection properties. and setup connection. > > =A0 =A0 =A0//host =3D "cindy"; > =A0 =A0 =A0host =3D "localhost"; > > =A0 =A0 =A0if (args.length !=3D 0) > =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 database =3D args[0]; > =A0 =A0 =A0 =A0 username =3D (args.length > 1) ? args[1] : null; > =A0 =A0 =A0 =A0 password =3D (args.length > 2) ? args[2] : null; > =A0 =A0 =A0} > =A0 =A0 =A0else > =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 database =3D "key_tables"; > =A0 =A0 =A0 =A0 username =3D ""; > =A0 =A0 =A0 =A0 password =3D ""; > =A0 =A0 =A0} > > =A0 =A0 =A0dbConnection =3D null; > =A0 =A0 =A0Class.forName("org.postgresql.Driver").newInstance(); > =A0 =A0 =A0dbConnection =3D DriverManager.getConnection("jdbc:postgresql:= //" + host > + "/" + database, username, > =A0 =A0 =A0 =A0 password); > =A0 =A0 =A0System.out.println("Connection Created"); > > =A0 =A0 =A0new PostgreSQL_JDBC(dbConnection); > > =A0 =A0 =A0// Close. > =A0 =A0 =A0dbConnection.close(); > =A0 =A0 =A0System.out.println("Connection Closed"); > =A0 } > > -- > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-jdbc > >