Someone here must have solved this problem before. We are having a
legacy code which uses raw sql with jdbc. Changing statement and
using "setString" is not an option.
Something like this:
String originalName = "AAA??AAA"; //some international characters
PreparedStatement pstmt = conn.prepareStatement("INSERT INTO user
(id,name) VALUES ('123','"+originalName+"')");
pstmt.execute();
….
pstmt = conn.prepareStatemnt(SELECT name FROM user WHERE id='123'");
ResultSet rs = pstmt.executeQuery();
rs.next();
String userName = rs.getString(1);
Now username does not match originalName. We are using Oracle 10.0.1,
jdk 1.5. Columns are NVARCHAR2, and defaultNChar= true.
Has anybody being able to solve this?