Bug #1065 Error in PreparedStatement.setString() when keyin string like "Peter's Apple"
Submitted: 16 Aug 2003 10:36 Modified: 16 Aug 2003 13:54
Reporter: Leung David Email Updates:
Status: Duplicate Impact on me:
Category:Connector / J Severity:S1 (Critical)
Version:3.0.8 OS:Windows (Windows 2000)
Assigned to: CPU Architecture:Any

[16 Aug 2003 10:36] Leung David
Dear sir,

I'm a Hong Kong programmer using Tomcat 4.1.24, Struts 1.1, MySQL 4.0 and Connector/J 3.0.8 to develop a web application on Windows 2000 platform. What problem I met is that when I input a string like "Peter's Apple" in a database with character set is Big5. I hope that this is my mistake rather than a bug in the JDBC driver.

Thank you.


How to repeat:
My Windows 2000 locale has set to Chinese (Hong Kong), JSP has the starting tag <%@ page contentType="text/html;charset=utf-8" %>, servlet has the line request.setCharacterEncoding("UTF8");. I use the connection pool that come with Struts by using the connection url: 

The application is quite good for input both English and Tradition Chinese without any special characters. Unfortunately when I input the string with "'", the Java throws the exception. Then I down grade the Connector/J version to 2.0.14, that's fine.
[16 Aug 2003 13:54] Mark Matthews
Duplicate of #1051