如果字符串连接成功的话,还有SQL语句没有错误的话按照下面的修改,我这里已经调试成功了
这样修改
把: Statement stmt=con.prepareStatement("insert into employee(id,name,sex,born,nation,minzu,zhengzhi,marry,school,zhiwei,tel,address) values ('"+snumber+"','"+sname+"','"+ssex+"','"+sbir+"','"+shometown+"','"+snation+"','"+sstatus+"','"+smarrage+"','"+seducation+"','"+sposition+"','"+smobile+"','"+saddress+"')");修改成:Statement stmt = con.createStatement();
stmt.executeQuery("insert into employee(id,name,sex,born,nation,minzu,zhengzhi,marry,school,zhiwei,tel,address) values ('"+snumber+"','"+sname+"','"+ssex+"','"+sbir+"','"+shometown+"','"+snation+"','"+sstatus+"','"+smarrage+"','"+seducation+"','"+sposition+"','"+smobile+"','"+saddress+"')");楼主满意的话记得给我+++++++++++加分+++++++++
HOME_ning(玩物丧志)
这样修改
把: Statement stmt=con.prepareStatement("insert into employee(id,name,sex,born,nation,minzu,zhengzhi,marry,school,zhiwei,tel,address) values ('"+snumber+"','"+sname+"','"+ssex+"','"+sbir+"','"+shometown+"','"+snation+"','"+sstatus+"','"+smarrage+"','"+seducation+"','"+sposition+"','"+smobile+"','"+saddress+"')");修改成:Statement stmt = con.createStatement();
stmt.executeQuery("insert into employee(id,name,sex,born,nation,minzu,zhengzhi,marry,school,zhiwei,tel,address) values ('"+snumber+"','"+sname+"','"+ssex+"','"+sbir+"','"+shometown+"','"+snation+"','"+sstatus+"','"+smarrage+"','"+seducation+"','"+sposition+"','"+smobile+"','"+saddress+"')");楼主满意的话记得给我+++++++++++加分+++++++++
HOME_ning(玩物丧志)
解决方案 »
- rs<K,V,N>中如何获取k、v、n的值?
- 网站监控如何设计
- wait阻塞的线程是不是一定要notify才能激活
- 怎么判断一个线程是否运行完毕?
- 请问各位大哥,这个问题怎么办???在线等。。。。。。。。。。。。。。。
- 求教:安装j2re-1_3_1_02-win-i.exe提示成功安装,可为什么还是不能运行
- 请问在applet中用socket做文件上传,应该如何做呢,applet能操作本地文件吗,有没有例子呢
- 寻求《jsp高级编程》电子版
- BufferedReader 中只有readLine(),能不能一次把所有的都读出来的?
- 60分寻找MS SQL7/2000 的JDBC,还可以再给分
- 一个布局怎么也调不好了,求助
- 包org.apache.bcel.util.BCELifier和com.sun.org.apache.bcel.internal.util.BCELifier
E Code0
E M=Can not issue data manipulation statements with executeQuery().
错
2).mysql的root用户相关问题,类似于此贴:
http://topic.csdn.net/u/20100518/17/03c76fdc-69a6-4b3f-af80-07296ca32443.html
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 'nation,minzu,zhengzhi,marry,school,zhiwei,tel,adress) values (123,as,s,1988-12-1' at line 1