Skip site navigation (1) Skip section navigation (2)

Regarding insertion of Unicode String in Postgres using jdbc.

From: Mamta Singh <mamta_csd(at)yahoo(dot)co(dot)in>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Regarding insertion of Unicode String in Postgres using jdbc.
Date: 2004-08-30 09:47:06
Message-ID: 20040830094706.18624.qmail@web8505.mail.in.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

I have created a table

create table temp1(a varchar(200));

and then I tried running the following code.

String msg1 = "\u0000mamta";
PreparedStatement preparedStmt =
pgConnection.prepareStatement("insert into mamtanow
values(?)");

preparedStmt.clearParameters();
preparedStmt.setString(1, msg1);
preparedStmt.executeUpdate();
			
preparedStmt.close();

And it throws an Exception saying "\0 not allowd"

what should I do ? How should I insert unicode string
using jdbc only ?

Thanks and Regards,
Mamta

=====
Mamta Singh

"Technical Skill is the mastery of complexity, while Creativity is the mastery of simplicity....."

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

Responses

pgsql-hackers by date

Next:From: chinniDate: 2004-08-30 10:06:37
Subject: error with unicode thing??
Previous:From: Fabien COELHODate: 2004-08-30 08:12:38
Subject: Re: [PATCHES] ALTER SCHEMA ... SET TABLESPACE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group