Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed - Mailing list pgsql-jdbc

From dmp
Subject Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed
Date
Msg-id 4B967DB4.8090104@ttc-cmc.net
Whole thread Raw
In response to org.postgresql.util.PSQLException: Protocol error. Session setup failed  (Major Services <services.major@gmail.com>)
Responses Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed  (Maciek Sakrejda <msakrejda@truviso.com>)
Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed  (Major Services <services.major@gmail.com>)
List pgsql-jdbc
Did not look up error, but looks like the Class.forName().
Attached standard main() to create a connection to PostgreSQL.

danap.

   //============================================================
   // 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");
   }

pgsql-jdbc by date:

Previous
From: Major Services
Date:
Subject: org.postgresql.util.PSQLException: Protocol error. Session setup failed
Next
From: Maciek Sakrejda
Date:
Subject: Re: org.postgresql.util.PSQLException: Protocol error. Session setup failed