Hi Everyone,
I am trying to read to read a foreign character from database (Get *£*100)
is giving some other character. I am using plain Java- JDBC connection. Just
wondering if there is anything that needs to be done apart from the below?
Below is the pseudo code:
connection = DriverManager.getConnection(
"jdbc:postgresql://127.0.0.1:5432/demodb?useUnicode=yes&characterEncoding=utf-8",
"test",
"test");
String sql = "select * from test_data";
ResultSet rs = stmt.executeQuery(sql);
while(rs.next()){
System.out.println(rs.getString(1)) // Returns Get *œ*100
Expected : Get *£*100)
}
DB is UTF-8
Postgres jar version : postgresql-9.0-801.jdbc4.jar
Appreciate if you could let me know if I am missing anything here?
Thanks,
Sai.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Reading-character-from-DB-is-displaying-character-tp5771897.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.