- 论坛徽章:
- 1
|
Connection C = DriverManager.getConnection(url, user, pwd);
Statement stmt = C.createStatement();
stmt.execute(insert into tblMails (FirstName,LastName,Email,Country) values ('三 ','張','三.張@tom.com','China') on duplicate key update FirstName='三', LastName='張', Country='China';);
錯誤信息:
java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''China' at line 1"
而從MYSQL 命令行下運行
insert into tblMails (FirstName,LastName,Email,Country) values ('三 ','張','三.張@tom.com','China') on duplicate key update FirstName='三', LastName='張', Country='China';
沒有問題
請教大俠了
先謝
[ 本帖最后由 perryhg 于 2006-7-20 02:12 编辑 ] |
|