Re: IllegalArgumentException in batch execution - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: IllegalArgumentException in batch execution
Date
Msg-id alpine.BSO.2.00.1006090209210.2333@leary.csoft.net
Whole thread Raw
In response to IllegalArgumentException in batch execution  (Altaf Malik <mmalik_altaf@yahoo.com>)
List pgsql-jdbc

On Tue, 8 Jun 2010, Altaf Malik wrote:

> All,
>  I have noticed a strange behavior in jdbc. Consider the following code:
>
>         PreparedStatement stmt = con.prepareStatement("insert into testtbl
> values(?,?)");
>
>             stmt.setInt(1, 110);
>             stmt.setString(2, "Hello\0 Mr.X");
>             stmt.addBatch();
>             stmt.executeBatch();
>
> When I execute this code, I get Two errors:
>
> (1):
> java.lang.IllegalArgumentException: org.postgresql.util.PSQLException: Zero
> bytes may not occur in string parameters.

This has been fixed in CVS.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: I can't get the database's list
Next
From: Craig Ringer
Date:
Subject: Re: I can't get the database's list