int select_id=Integer.parseInt(production.getText());
String name_str=type.getText();
ResultSet set = smt.executeQuery("select * from [sheet1$] where Id="+select_id +"and UserName="+name_str);
运行到红色部分语句时,总是出现错误java.sql.SQLException: [Microsoft][ODBC Excel Driver] 参数不足,期待是 1。
不知道哪出错了?请教!谢谢!
------解决方案--------------------
ResultSet set = smt.executeQuery("select * from [sheet1$] where Id='"+select_id +"' and UserName=[color=#FF0000][/color]'"+name_str + "'");
试试
------解决方案--------------------
查下你连接的Excel的列有没有Id和UserName这两列