Return-Path: X-Original-To: apmail-incubator-empire-db-user-archive@minotaur.apache.org Delivered-To: apmail-incubator-empire-db-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 783637C5D for ; Mon, 7 Nov 2011 08:42:08 +0000 (UTC) Received: (qmail 46884 invoked by uid 500); 7 Nov 2011 08:42:08 -0000 Delivered-To: apmail-incubator-empire-db-user-archive@incubator.apache.org Received: (qmail 46868 invoked by uid 500); 7 Nov 2011 08:42:08 -0000 Mailing-List: contact empire-db-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: empire-db-user@incubator.apache.org Delivered-To: mailing list empire-db-user@incubator.apache.org Received: (qmail 46860 invoked by uid 99); 7 Nov 2011 08:42:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2011 08:42:08 +0000 X-ASF-Spam-Status: No, hits=1.6 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cnj125@gmail.com designates 209.85.213.47 as permitted sender) Received: from [209.85.213.47] (HELO mail-yw0-f47.google.com) (209.85.213.47) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2011 08:42:03 +0000 Received: by ywf9 with SMTP id 9so4738860ywf.6 for ; Mon, 07 Nov 2011 00:41:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=bPNK1QlEbjfZ9C2A7ceyyfXDNvPSwPwDRyFpaWGDY0U=; b=F2n9vZ5ZxIGBijA3Ehq6Fx1ckbZL/uRrMLwxu69kp6neZTikvxmqJ49IZTsNna0Le0 qTnCMoS/eObubOEaynqo2f/9yTpja4yc5pyCudMGQYtR8Ofz/N6iCbzJKDt4BunNxxMS ONwC4TiNCAQptISfLt0I60J1tdJPwkCRm0TxI= MIME-Version: 1.0 Received: by 10.42.139.2 with SMTP id e2mr41030005icu.22.1320655302170; Mon, 07 Nov 2011 00:41:42 -0800 (PST) Received: by 10.42.108.193 with HTTP; Mon, 7 Nov 2011 00:41:42 -0800 (PST) In-Reply-To: References: Date: Mon, 7 Nov 2011 16:41:42 +0800 Message-ID: Subject: Re: Inserting Chinese character record to DB From: Ben Ng To: empire-db-user@incubator.apache.org Content-Type: multipart/alternative; boundary=90e6ba6136f62817c304b1210630 --90e6ba6136f62817c304b1210630 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Rainer, It seems that my problem have been solved when I enable prepared statement. Thank you for your help. Regards, Ben On Mon, Nov 7, 2011 at 4:19 PM, Rainer D=F6bele wrote: > Hi Ben,**** > > ** ** > > I don=92t know for sure but it may be a good idea to tell Empire-db to us= e > prepared statements.**** > > Simply write:**** > > db.setPreparedStatementsEnabled(true);**** > > in your initialization code.**** > > ** ** > > Please let us know whether this works and tell us which DBMS and > JDBC-Driver you are using.**** > > Regards**** > > ** ** > > Rainer**** > > ** ** > > ** ** > > *from:* Ben Ng [mailto:cnj125@gmail.com] > *to:* empire-db-user@incubator.apache.org > *re:* Re: Inserting Chinese character record to DB**** > > ** ** > > Hi Empire-DB team, > > I am trying to insert a record with Chinese character from my JSP page. > The encoding is set to UTF-8 already and I am trying to insert the record= by the code below where "remarks" is a string contain Chinese characters. > > **** > > ** ** > > > DBRecord rec =3D new DBRecord(); > rec.create(db.REQUESTS); > rec.setValue(db.REQUESTS.REMARKS, remarks); > rec.update(conn); > > After inserting the record, the data of the field REMARKS become "???". > > **** > > ** ** > > I tried to use traditional method(PreparedStatement) to insert this recor= d by using the same db and connection. > The data can be inserted correctly. > Is there any step I have missed in my code so it can support UTF-8? > > **** > > ** ** > > > I really appreciate for what your team have done. Thanks a lot. > > Thanks & Regards, > Ben**** > > --90e6ba6136f62817c304b1210630 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Rainer,

It seems that my problem have been solved when I enable p= repared statement. Thank you for your help.

Regards,
Ben

<= div class=3D"gmail_quote">On Mon, Nov 7, 2011 at 4:19 PM, Rainer D=F6bele <= span dir=3D"ltr"><doebele@esteam.de= > wrote:

Hi Ben,

=A0

I don=92t know for sure but it may be a go= od idea to tell Empire-db to use prepared statements.<= /p>

Simply write:

db.setPreparedStatementsEnabled(true);

in your initialization code.

<= u>=A0

Please let us know whether this works and tell us which DBMS and= JDBC-Driver you are using.

= Regards

=A0

Rainer

=A0=

=A0

from: Ben Ng [mailto:cnj= 125@gmail.com]
to: empire-db-user@incubator.apache.org
re: Re: Insertin= g Chinese character record to DB

<= div class=3D"h5">

=A0

Hi Empire-DB team,

I am trying to insert a record with Chinese cha= racter from my JSP page.
The encoding is set to UTF-8 already and I am t= rying to insert the record by the code below where "remarks" is a= string contain Chinese characters.

=A0

DBRecord rec = =3D new DBRecord();
rec.create(db.REQUESTS);
rec.setValue(db.REQUESTS= .REMARKS, remarks);
rec.update(conn);

After inserting the record,= the data of the field REMARKS become "???".

=A0
I tried to use tra=
ditional method(PreparedStatement) to insert this record by using the same =
db and connection. 
The data can be inserted correctly.
Is there any = step I have missed in my code so it can support UTF-8?

=A0

I really appre= ciate for what your team have done. Thanks a lot.

Thanks & Regar= ds,
Ben

--90e6ba6136f62817c304b1210630--