• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Postgresql jdbc driver - client encoding

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic