Results 1 to 5 of 5
- 10-15-2012, 03:54 PM #1
Member
- Join Date
- Oct 2012
- Posts
- 3
- Rep Power
- 0
Postgresql with JDBC - Client encoding issue
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"
Please provide any suggestions
- 10-15-2012, 05:13 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Postgresql with JDBC - Client encoding issue
Don't use WIN1252 character encoding on your database?
At least if I've interpreted that log output correctly.Please do not ask for code as refusal often offends.
- 10-16-2012, 07:52 AM #3
Member
- Join Date
- Oct 2012
- Posts
- 3
- Rep Power
- 0
Re: Postgresql with JDBC - Client encoding issue
Thank you for your reply.
If i use the same insert query in PgAdmin tool , values are successfully inserted.
Through PostgreSQL JDBC driver only we are facing problems.
It seems the client_encode will be always set to Unicode in jdbc while start up.
Ref :
How to insert Chinese (big5) through JDBC? - Grokbase
After converting the Chinese string to Unicode in our program, we can able to insert through jdbc.
Is this the only option? Can we set the client_encode according to our need in jdbc?
Regards,
Preethi.
- 10-16-2012, 10:04 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Postgresql with JDBC - Client encoding issue
With characters you need to ensure you are using the same character set throughout.
Well, either that or attempt to convert them which is not much fun.
The PgAdmin tool will be using whatever character set the db is set up for, so it's no great surprise that that works.Please do not ask for code as refusal often offends.
- 10-16-2012, 12:29 PM #5
Member
- Join Date
- Oct 2012
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Encoding issue
By kerimabdullah in forum New To JavaReplies: 1Last Post: 03-08-2012, 07:03 PM -
Looking for PostgreSQL libraries - Type 2 JDBC or JNI
By couling in forum JDBCReplies: 3Last Post: 12-12-2010, 08:25 PM -
help with jdbc for postgresql
By arano86 in forum New To JavaReplies: 2Last Post: 09-14-2009, 12:27 PM -
encoding issue in jsp
By sams11 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 11-25-2008, 07:55 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks