• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Postgres JDBC encoding...

 
Max Fildner
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello! Can somebody help me to resolve the following issue? Thanks.

I have the text file. Its encoding is ISO-8859-1. How did I know this? I opened the file in my Firefox and looked at the menu Web developer-> Character Encoding.
In Firefox I see the following string in the file: "aaaébbb".
I read this file in Java program using the following code:

When I print strLine in my Eclipse console I see this string: "aaaГ©bbb". Eclipse console is configured to show in Cp1251 encoding.
I have Postgres 9.0 database and the same string in it. When I select it via pgAdmin I see the same as in Eclipse console.
Now I need to read this string from file and to select from DB via JDBC using this string in WHERE clause.
But my select returns zero result.
When I change my sql from "WHERE field='"+strLine+"'" to "WHERE field LIKE 'aaa__bbb'" result is fine.

How can I use my string from file for correct select via JDBC? Thanks for any help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic