首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

为什么会出现这样的异常呢?

2011-11-21 
为什么会出现这样的错误呢??部分程序如下:Connection con nullStatement sm null....sm con.creat

为什么会出现这样的错误呢??
部分程序如下: 
Connection con = null; 
Statement sm = null; 
.... 
sm = con.createStatement(); 
sm.executeUpdate("delete from test_table1"); 
String s = "hello"; 
sm.executeUpdate("insert into test_table1(name0) values("+ s +")"); 
sm.executeUpdate("insert into test_table1(name1) values("+ s +")"); 
错误提示: 
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'hello' in 'field list 
这错误是什么意思呢?? 


[解决办法]
sm.executeUpdate("insert into test_table1(name1) values('"+ s +"')"); 试试

热点排行