Re: IllegalArgumentException in batch execution

From: Kris Jurka <books(at)ejurka(dot)com>
To: Altaf Malik <mmalik_altaf(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: IllegalArgumentException in batch execution
Date: 2010-06-09 06:10:55
Message-ID: alpine.BSO.2.00.1006090209210.2333@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2010-06-09 06:14:08 Re: I can't get the database's list
Previous Message Kris Jurka 2010-06-09 06:09:17 Re: I can't get the database's list