public static void main(String[] args) {
Company_base company=new Company_base();
company.setUser_id(10086L);
company.setCname("上海苏沃");
company.setCename("suwort");
company.setCadress("上海");
company.setCinfo("的地对地导弹地对地导弹地对地导弹地对地导弹地对地导弹地对地导弹地对地导弹");
company.setCphone("0796-5825261");
company.setCmoble("13576604760");
company.setClinkman("张三 18658145132:李四 1388888888");
company.setCfax("0796-5815522");
company.setCmsn("Atsilence@hotmail.com");
company.setCwangwang("123456:666666:12151");
company.setCqq("53155131:45211515");
company.setCemail("yoyo_zy@126.com");
company.setCpostcode("343800");
company.setCwebsite("www.suwort.com:www.suwort.com.cn");
IbatisDao dao=new IbatisDao();
dao.insert("insertCompany", company);
}
如果设置SqlMapConfig.properties
链接+?useUnicode=TRUE&characterEncoding=UTF-8
的话报错
2012-11-21 15:30:18,781 [DEBUG] [main] [0] [java.sql.Connection] [{conn-100000} Connection]
2012-11-21 15:30:18,796 [DEBUG] [main] [15] [java.sql.Connection] [{conn-100000} Preparing Statement: INSERT INTO info_company(id,user_id,cname,cename,cadress,cpostcode,cinfo,cphone,cfax,cmoble,clinkman,cwebsite,cemail,cqq,cwangwang,cmsn) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ]
2012-11-21 15:30:18,828 [DEBUG] [main] [47] [java.sql.PreparedStatement] [{pstm-100001} Executing Statement: INSERT INTO info_company(id,user_id,cname,cename,cadress,cpostcode,cinfo,cphone,cfax,cmoble,clinkman,cwebsite,cemail,cqq,cwangwang,cmsn) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ]
2012-11-21 15:30:18,828 [DEBUG] [main] [47] [java.sql.PreparedStatement] [{pstm-100001} Parameters: [0, 10086, 上海苏沃, suwort, 上海, 343800, 的地对地导弹地对地导弹地对地导弹地对地导弹地对地导弹地对地导弹地对地导弹, 0796-5825261, 0796-5815522, 13576604760, 张三 18658145132:李四 1388888888, www.suwort.com:www.suwort.com.cn, yoyo_zy@126.com, 53155131:45211515, 123456:666666:12151, Atsilence@hotmail.com]]
2012-11-21 15:30:18,828 [DEBUG] [main] [47] [java.sql.PreparedStatement] [{pstm-100001} Types: [java.lang.Long, java.lang.Long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String]]
2012-11-21 15:30:18,843 [ERROR] [main] [62] [common.db.ibatis.IbatisDao] [common.db.ibatis.IbatisDao :
--- The error occurred in beans/Company_base.xml.
--- The error occurred while applying a parameter map.
--- Check the Company_base.Company_base.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: Incorrect string value: '\xE4\xB8\x8A\xE6\xB5\xB7...' for column 'cname' at row 1]
------解决方案--------------------
求解决办法....
------解决方案--------------------
程序和数据库的运行环境描述一下
------解决方案--------------------