From: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
To: Major Services <services.major@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed
Date: Wed, 10 Mar 2010 11:32:18 +1300
Message-ID: <4B96CC72.2070306@catalyst.net.nz> (raw)
In-Reply-To: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com>
References: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: mark.kirkwood@catalyst.net.nz, services.major@gmail.com
Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed
In-Reply-To: <4B96CC72.2070306@catalyst.net.nz>
References: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com> <4B96CC72.2070306@catalyst.net.nz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox