Small bug: In 9.2-1000, PreparedStatement.toString shows byte[].toString for int types

From: Larry Reeder <lnreeder(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Small bug: In 9.2-1000, PreparedStatement.toString shows byte[].toString for int types
Date: 2012-10-28 18:52:03
Message-ID: CADO6nCgmcrauuoSRNKiP0FcxF0BNg-dU-tVD0rWSmiVmvPNtfQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Low priority (for me at least), but the PreparedStatement.toString for
the most recent version of the driver looks funny when it prints a
prepared statement that has an Int parameter. Looks like the integer
is stored as a byte array, and the code just does a toString on the
byte array.

Tested with 9.2-1000:

//normal connection setup stuff here...

PrepartedStatement statement =
connection.prepareStatement("update foobar set name = ?, count = ?");
statement.setString(1, "bazz");
statement.setInt(2, 20);

System.out.println("Statement is: " + statement.toString());

Prints out:

"Statement is: update foobar set name = 'bazz', count = '[B(at)19b8e059'"

Thanks.............. Larry

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2012-10-28 23:31:46 Re: JDBC4 Postgresql Driver
Previous Message Dave Cramer 2012-10-26 20:36:25 Re: JDBC4 Postgresql Driver