Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id BE462632659 for ; Tue, 9 Mar 2010 18:32:33 -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 02448-10 for ; Tue, 9 Mar 2010 22:32:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.catalyst.net.nz (bertrand.catalyst.net.nz [202.78.240.40]) by mail.postgresql.org (Postfix) with ESMTP id 0D754634130 for ; Tue, 9 Mar 2010 18:32:22 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 4F50E331C9; Wed, 10 Mar 2010 11:32:19 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ww4FZpu1R7GU; Wed, 10 Mar 2010 11:32:19 +1300 (NZDT) Received: from [IPv6:2404:130:0:1000:222:15ff:fe5c:2471] (unknown [IPv6:2404:130:0:1000:222:15ff:fe5c:2471]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id DCE6C326C4; Wed, 10 Mar 2010 11:32:18 +1300 (NZDT) Message-ID: <4B96CC72.2070306@catalyst.net.nz> Date: Wed, 10 Mar 2010 11:32:18 +1300 From: Mark Kirkwood User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Major Services CC: pgsql-jdbc@postgresql.org Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed References: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com> In-Reply-To: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.89 tagged_above=-10 required=5 tests=AWL=-0.150, BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 201003/26 X-Sequence-Number: 20366 Major Services wrote: > I am trying to connect to PostgreSQL database on my local system. > > The code is: > > Class.forName("org.postgresql.Driver"); > String url = > "jdbc:postgresql://localhost:5432/postgres?user=postgres&password=major"; > Connection conn = DriverManager.getConnection(url); > > Running the code I get: > > org.postgresql.util.PSQLException: Protocol error. Session setup failed. > > Using postgresql-8.4-701.jdbc3 on PostgreSql 8.4 > > > > > Try adding some debug info (will help us see what is going on) - e.g: Class.forName("org.postgresql.Driver"); String url = "jdbc:postgresql://localhost:5432/postgres?user=postgres&password=major"; Properties props = new Properties(); props.setProperty("loglevel","2"); Connection conn = DriverManager.getConnection(url, props); regards Mark