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

Mon, 30 Aug 2004 10:47:06 +0100 (BST)
=?iso-8859-1?q?Mamta=20Singh?= <mamta_csd@yahoo.co.in>
Regarding insertion of Unicode String in Postgres using jdbc.
Try using a bytea field instead of a text one.

Chris

Mamta Singh wrote:

> 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
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

Tue, 31 Aug 2004 09:16:04 +0800
Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Re: Regarding insertion of Unicode String in Postgres using