动态数据库问题(急!!!!)
String sql = "select * from AttackTable where name="+thename;
其中thename 是通过文本筐获得的参数 thename=String.Valueof(tx1.getText());
可是为什么提示"参数不足,期待是 1。"
但是换成int型变量如下:
String sql = "select * from AttackTable where ID="+theid;
其中theid 是通过文本筐获得的参数 theid=Integer.parseInt(tx1.getText());
就没问题了呢?
请各位高手帮帮忙啊!!!1小弟在这先谢谢了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
问题点数:20、回复次数:4Top
1 楼ygc(狒狒)回复于 2005-06-01 12:55:06 得分 10
这个是你的SQL语句写错了,可能得写成
String sql = "select * from AttackTable where name='"+thename+"'";
Top
2 楼lg820505(木鱼)回复于 2005-06-01 13:02:29 得分 5
有道理Top
3 楼ses127127(ses)回复于 2005-06-01 13:08:47 得分 5
同意楼上的Top
4 楼stupidfish2004()回复于 2005-06-01 13:33:50 得分 0
在这个问题上被卡了好久,太感谢各位了,真的!Top




