8.2dev-500.jdbc3 driver: PreparedStatement.toString() is buggy - Mailing list pgsql-jdbc

From j.random.programmer
Subject 8.2dev-500.jdbc3 driver: PreparedStatement.toString() is buggy
Date
Msg-id 20051219185723.47640.qmail@web32010.mail.mud.yahoo.com
Whole thread Raw
Responses Re: 8.2dev-500.jdbc3 driver: PreparedStatement.toString()
List pgsql-jdbc
Hi:

There seems to be a bug with the 8.2dev-500
driver, running against a postgres 8.1 database.

If I have a PreparedStatement, then when I say:

System.out.println(ps)

the the prepared statement that is printed is
*missing* single quotes around data/time AND
character/string values. This means that I
cannot copy that preparedstatment and paste
it directly into a psql session etc.

For example, this is what a ps.toString() looks like:
--------------------------------------
 INSERT into alltypes (smallint_val, int_val,
bigint_val, float_val, double_val, numeric_val,
char_val, varchar_val, timestamp_val, bit_val,
varbinary_val) values (5, 6, 7000, 3.14, 3.141, 11.32,
foo2, bar2, 2005-12-19 09:55:23.464000 -0500, 1,
<stream of 5 bytes>)
-------------------------------------

Note, this is not valid sql since no quotes around
'foo2', 'bar2', '2005...' etc (which are
respectively char and date types).

This is definitely a regression, this did not happen
with earlier drivers.

Best regards,

--j

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

pgsql-jdbc by date:

Previous
From: Markus Schaber
Date:
Subject: Re: Create Database using JDBC
Next
From: "j.random.programmer"
Date:
Subject: Bug: Driver(8.2dev-500.jdbc3) does not handle boolean->BIT correctly