Re: Character set/Collation problem in MySQL 4.1
I have a similar problem. I'm trying to insert a java string value into a table but the special characters (\u2019 and \u2018 quotes in this case) get converted to questionmarks.
I'm using 4.1.7-standard on linux (fedora core2). If I run the same program against 4.1.8-nt running on windows XP. (I am using the latest version of the jdbc driver as well.)
Suggestions?
String s = new String("\u2019hello\u2018");
PreparedStatement ps = m_conn.prepareStatement("INSERT INTO myRecords(TITLE) VALUES( ? )");
ps.setString(1,s);
ps.executeUpdate();
ps = m_conn.prepareStatement("select title from myRecords where title like ?");
ps.setString(1,s);
rs = ps.executeQuery();
if (rs.next()) {
String title = rs.getString(1);
if (title.equalsIgnoreCase(s))
System.out.println("insert worked");
else
System.out.println("insert failed: title is " + title);
} else {
System.out.println("no result set");
}
Subject
Views
Written By
Posted
7116
January 17, 2005 01:23PM
2799
January 20, 2005 02:12AM
2869
March 02, 2005 07:42AM
Re: Character set/Collation problem in MySQL 4.1
2938
April 02, 2005 01:18PM
2752
April 06, 2005 07:38AM
2166
November 01, 2006 04:20AM
2428
May 21, 2005 11:34AM
2421
August 03, 2005 04:46PM
2148
November 07, 2006 12:34AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.