Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id DD008633A79 for ; Wed, 9 Jun 2010 03:11:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 64963-06 for ; Wed, 9 Jun 2010 06:10:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id E30B96322D0 for ; Wed, 9 Jun 2010 03:10:56 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id D20F028410; Wed, 9 Jun 2010 02:10:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=R8IyPo/IzR3yMNXJX+zb47nyjZM=; b=Lw5M1q WRbbuYQ5w9edC8e7i9kvNXZfsjFl96SXZqd4qabybcGNxl9oMXW3Z510W/4ofhVz oRjB72yjQCrsJbwtH5ym0oJCIjt0zpQgXnJbQXHQ3CABIUD4JFDNcKMY17Z9KT1A SYWoUDX4pJMVFkrnkOw9jyiFphgB4NxOG7VrQ= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id CA9D02840A; Wed, 9 Jun 2010 02:10:55 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 822A0A431; Wed, 9 Jun 2010 02:10:55 -0400 (EDT) Date: Wed, 9 Jun 2010 02:10:55 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Altaf Malik cc: pgsql-jdbc@postgresql.org Subject: Re: IllegalArgumentException in batch execution In-Reply-To: <384952.35231.qm@web110413.mail.gq1.yahoo.com> Message-ID: References: <384952.35231.qm@web110413.mail.gq1.yahoo.com> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.011 tagged_above=-10 required=5 tests=BAYES_40=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Archive-Number: 201006/51 X-Sequence-Number: 20621 On Tue, 8 Jun 2010, Altaf Malik wrote: > All, > =A0I have noticed a strange behavior in jdbc. Consider the following code: >=20 > =A0=A0=A0=A0=A0=A0=A0 PreparedStatement stmt =3D con.prepareStatement("in= sert into testtbl > values(?,?)"); >=20 > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 stmt.setInt(1, 110); >=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 stmt.setString(2, "Hello\0 Mr.X"); > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 stmt.addBatch(); > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 stmt.executeBatch(); >=20 > When I execute this code, I get Two errors: >=20 > (1): > java.lang.IllegalArgumentException: org.postgresql.util.PSQLException: Ze= ro > bytes may not occur in string parameters. This has been fixed in CVS. Kris Jurka=