Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 645EE633587 for ; Wed, 10 Mar 2010 16:31:42 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 97149-08 for ; Wed, 10 Mar 2010 20:31:31 +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 CDE7763585B for ; Wed, 10 Mar 2010 16:31:31 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id B56B733468; Thu, 11 Mar 2010 09:31:28 +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 G-xZK0xRTsFK; Thu, 11 Mar 2010 09:31:28 +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 7936432245; Thu, 11 Mar 2010 09:31:28 +1300 (NZDT) Message-ID: <4B9801A0.8080607@catalyst.net.nz> Date: Thu, 11 Mar 2010 09:31:28 +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> <4B96CC72.2070306@catalyst.net.nz> <375c2da1003100631n22609890x36e522cf509eaaa6@mail.gmail.com> In-Reply-To: <375c2da1003100631n22609890x36e522cf509eaaa6@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.185 tagged_above=-10 required=5 tests=BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 201003/39 X-Sequence-Number: 20379 Oh dear - probably missing imports or something in your code. Maybe try running a standalone java program from the command line (see below), as thats what I used to check this: $ export CLASSPAT=path-to-your-postgresql.jar:. $ java test1 ---- test1.java --- import java.sql.*; import java.util.*; public class test1 { public static void main( String args[] ) throws Exception { 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); System.out.println( "Connected to: " + url ); conn.close (); } } Major Services wrote: > 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: } >