Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Postgresql jdbc driver - client encoding

 
Preethi Selvaraj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my project, we are using PostgreSQL jdbc driver for inserting data into db.
The values may contain other languages like Chinese, Japanese, German expressions.

Apart from inserting the English expression, am getting the following exceptions:

2012-10-11 02:41:37,589 [HttpClient-15] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 22P05
2012-10-11 02:41:37,589 [HttpClient-15] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 4 insert into summary (value, id, property) values ('Microsoft Windows 7 ??? ', '7', 'Name') was aborted. Call getNextException to see the cause.
2012-10-11 02:41:37,589 [HttpClient-15] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 22P05
2012-10-11 02:41:37,589 [HttpClient-15] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: character 0xe69797 of encoding "UTF8" has no equivalent in "WIN1252"


While start up, client encode will be set to unicode in jdbc.
If we convert the string to unicode and then insert through jdbc it works fine.
Is this the only option? or can we change the client encode according to our need?

Please provide me some suggestions.

Regards,
Preethi.
 
Preethi Selvaraj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My problem is solved.
I created my database with utf8 encoding option as shown below. After that i can able to insert any language string into database.

CREATE DATABASE sample WITH ENCODING 'UTF8' TABLESPACE sampledb TEMPLATE=template0;

Thanks,
Preethi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic