X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D27A29F94EA for ; Mon, 22 May 2006 05:27:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 28531-04 for ; Mon, 22 May 2006 05:27:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from iplocks.co.jp (iplocks.co.jp [211.19.47.137]) by postgresql.org (Postfix) with SMTP id 558909F946B for ; Mon, 22 May 2006 05:27:22 -0300 (ADT) Received: (qmail 21472 invoked from network); 22 May 2006 17:26:53 +0900 Received: from unknown (HELO ebihara) (216.132.219.66) by iplocks.co.jp with SMTP; 22 May 2006 17:26:53 +0900 From: "EBIHARA, Yuichiro" To: Subject: Re: how to handle data containing '\0' Date: Mon, 22 May 2006 17:28:41 +0900 Message-ID: <00ae01c67d79$bee68110$af6cfea9@ipljp.local> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Importance: Normal In-Reply-To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/94 X-Sequence-Number: 15222 Thanks, Kris. I understand the behavior is server-side issue, not JDBC, and we are to be forced to explicitely remove '\0' with the latest server releases. It's not necessarily the best for me but better than now. Finally, do you know the thread containing the discussion that triggered the change of server behavior? Thanks, ebi > -----Original Message----- > From: Kris Jurka [mailto:books@ejurka.com] > Sent: Monday, May 22, 2006 4:29 PM > To: EBIHARA, Yuichiro > Cc: pgsql-jdbc@postgresql.org > Subject: Re: [JDBC] how to handle data containing '\0' > > > > > On Wed, 17 May 2006, EBIHARA, Yuichiro wrote: > > > I need to handle String data containing '\0' in my Java + JDBC > > program. > > > > Now I have to support two versions of drivers, 7.4 and 8.1, but the > > behavior of driver depends on versions when I insert this > String value. > > > > This was changed between 7.4 and 8.0 when prepared statements > changed from > dynamically creating a sql string from the parameters to passing the > parameters separately. When creating a sql string the > parameters had to > be carefully checked for ' and \ so checking for \0 was also > done. When > passing the parameters separately there is no need for the ' > and \ checks > so the \0 check was removed as well either unintentionally or for > perfomance reasons. > > New server releases for all versions will be out this week > that fix the > problem on the server side by explicitly rejecting \0 rather than > truncating. > > Kris Jurka > > > >