Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 00527635D92 for ; Wed, 10 Mar 2010 10:31:26 -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 90506-10 for ; Wed, 10 Mar 2010 14:31:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f46.google.com (mail-ww0-f46.google.com [74.125.82.46]) by mail.postgresql.org (Postfix) with ESMTP id EF790635B74 for ; Wed, 10 Mar 2010 10:31:15 -0400 (AST) Received: by wwb39 with SMTP id 39so1059832wwb.19 for ; Wed, 10 Mar 2010 06:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=sW9INYerT9yLYqDsxLc/BzrlkR6FBEx3i7hmg7g4Ols=; b=enyELLx1nHvLeuM7TbmNSCThjJ4wULk/3gllQcuI3uyi5xuP4JZuwDYAwhRKbtNjM+ j3ItK4F8hWULXaBU4PCCVTinSzG/KbG2ZzhiSimi4vfnJlpJgUkftLvjRAmuHNJS+DcQ SXu5niJ5o0DiYXL0n+MTGfU9MHXhIXUlqOrZs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=VCQpMVPrXGizbITZeiQp+YqAZWA0VL/hV5o8IiJd9Hj+bOZz/Qe1l3kEm06DKtygUW iJsosWmqjtCdNBDwS8TMimkCbvmADdFloWDq63056rX2a5LKSjWzcaXh0W2NOSFYjKcr aNfGnA2ZKxRsWYR+/ZUeS2P5Nr44/0w4JJYD8= MIME-Version: 1.0 Received: by 10.216.86.200 with SMTP id w50mr967586wee.173.1268231472614; Wed, 10 Mar 2010 06:31:12 -0800 (PST) In-Reply-To: <4B96CC72.2070306@catalyst.net.nz> References: <375c2da1003090851h36daef83v2ced94b02051b08b@mail.gmail.com> <4B96CC72.2070306@catalyst.net.nz> Date: Wed, 10 Mar 2010 20:01:11 +0530 Message-ID: <375c2da1003100631n22609890x36e522cf509eaaa6@mail.gmail.com> Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed From: Major Services To: Mark Kirkwood Cc: pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=0016e6dab11b6b0f7a0481732642 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.296 tagged_above=-10 required=5 tests=AWL=0.302, BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201003/31 X-Sequence-Number: 20371 --0016e6dab11b6b0f7a0481732642 Content-Type: text/plain; charset=ISO-8859-1 Hi, Following is the error report: org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 13 in the jsp file: /jsp/pgtest.jsp Properties cannot be resolved to a type 10: { 11: Class.forName("org.postgresql.Driver"); 12: String url = "jdbc:postgresql://localhost:5432/postgres?user=postgres&password=major"; 13: Properties props = new Properties(); 14: props.setProperty("loglevel","2"); 15: Connection conn = DriverManager.getConnection(url, props); 16: } Thanks On Wed, Mar 10, 2010 at 4:02 AM, Mark Kirkwood < mark.kirkwood@catalyst.net.nz> wrote: > 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 > --0016e6dab11b6b0f7a0481732642 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
Following is the error report:

org.apache.jasper.JasperE= xception: Unable to compile class for JSP:

An error occurred at lin= e: 13 in the jsp file: /jsp/pgtest.jsp
Properties cannot be resolved to = a type
10: {
11: Class.forName("org.postgresql.Driver");
12: Stri= ng url =3D "jdbc:postgresql://localhost:5432/postgres?user=3Dpostgres&= amp;password=3Dmajor";
13: Properties props =3D new Properties();<= br>14: props.setProperty("loglevel","2");
15: Connection conn =3D DriverManager.getConnection(url, props);
16: }<= br>
Thanks

On Wed, Mar 10, 2010 at 4= :02 AM, Mark Kirkwood <mark.kirkwood@catalyst.net.nz> wrote:
<= div class=3D"h5">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 =3D "jdbc:postgresql://localhost:5432/postgres?user=3Dpostg= res&password=3Dmajor";
Connection conn =3D 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:



=A0Class.forName("org.postgresql.Driver");
=A0String url =3D "jdbc:postgresql://localhost:5432/postgres?user=3Dpo= stgres&password=3Dmajor";

=A0Properties props =3D new Properties();
=A0props.setProperty("loglevel","2");

=A0Connection conn =3D DriverManager.getConnection(url, props);



regards

Mark

--0016e6dab11b6b0f7a0481732642--