Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 539C5632B4B for ; Tue, 9 Mar 2010 13:12:47 -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 11881-04 for ; Tue, 9 Mar 2010 17:12:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outbound.vnet-inc.com (outbound.vnet-inc.com [216.146.104.103]) by mail.postgresql.org (Postfix) with ESMTP id 5FA1A632A1D for ; Tue, 9 Mar 2010 13:12:36 -0400 (AST) Received: from [192.168.157.32] (unknown [216.129.226.185]) by outbound.vnet-inc.com (Postfix) with ESMTP id 46C865B95; Tue, 9 Mar 2010 10:12:34 -0700 (MST) Message-ID: <4B967DB4.8090104@ttc-cmc.net> Date: Tue, 09 Mar 2010 09:56:20 -0700 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Major Services , 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: multipart/mixed; boundary="------------000403050409000305070506" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.11 tagged_above=-10 required=5 tests=BAYES_05=-1.11 X-Spam-Level: X-Archive-Number: 201003/23 X-Sequence-Number: 20363 This is a multi-part message in MIME format. --------------000403050409000305070506 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Did not look up error, but looks like the Class.forName(). Attached standard main() to create a connection to PostgreSQL. danap. --------------000403050409000305070506 Content-Type: text/plain; name="standardmain_connect.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="standardmain_connect.java" //============================================================ // Main public access point method for instantiating the // PostgreSQL_JDBC application. Arguments: database, username, // & password. // ============================================================== public static void main(String[] args) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException, InterruptedException { String host, database, username, password; Connection dbConnection; // Collect connection properties. and setup connection. //host = "cindy"; host = "localhost"; if (args.length != 0) { database = args[0]; username = (args.length > 1) ? args[1] : null; password = (args.length > 2) ? args[2] : null; } else { database = "key_tables"; username = ""; password = ""; } dbConnection = null; Class.forName("org.postgresql.Driver").newInstance(); dbConnection = DriverManager.getConnection("jdbc:postgresql://" + host + "/" + database, username, password); System.out.println("Connection Created"); new PostgreSQL_JDBC(dbConnection); // Close. dbConnection.close(); System.out.println("Connection Closed"); } --------------000403050409000305070506--