当前位置: 代码迷 >> Eclipse >> 为什么会出现这样的异常呢?
  详细解决方案

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

热度:73   发布时间:2016-04-23 14:12:39.0
为什么会出现这样的错误呢??
部分程序如下: 
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 +"')"); 试试
  相关解决方案