Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed

From: Major Services <services(dot)major(at)gmail(dot)com>
To: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed
Date: 2010-03-10 14:31:11
Message-ID: 375c2da1003100631n22609890x36e522cf509eaaa6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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(dot)kirkwood(at)catalyst(dot)net(dot)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
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Guillaume Cottenceau 2010-03-10 14:54:58 Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed
Previous Message Emmanuel Guiton 2010-03-10 13:32:25 Re: JDBC driver, client_encoding and a SQL_ASCII database in production