日期:2014-05-16 浏览次数:20733 次
用JDBC进行Mysql的数据备份和恢复,遇到特殊字符,处理起来还真麻烦...不想多说了
String ss;
....
ss = ss.replaceAll("\\\\", "\\\\\\\\"); ss = ss.replaceAll("\r\n", "\\\\r\\\\n"); ss = ss.replaceAll("\r", "\\\\r"); ss = ss.replaceAll("\t", "\\\\t"); ss = ss.replaceAll("\"", "\\\\\""); ss = ss.replaceAll("\'", "\\\\\'");