ResultSet rsArticle=mydb.executeQuery("Select * from article where newsrid="+sID);
改为
ResultSet rsArticle=mydb.executeQuery("Select * from article where newsrid="+"'"+sID+"'");
改为
ResultSet rsArticle=mydb.executeQuery("Select * from article where newsrid="+"'"+sID+"'");
解决方案 »
- 急!!求高手帮忙
- java中如何完成倒计时
- 求一个java正则表达式,提取div内容
- 高手们帮个忙~~~
- 求一个验证ipv4,ipv6,FQDN的方法
- 那位高手知道如何获得ClassLoader的搜索类的路径?
- IE带的jvm相当于jdk的那个版本?
- 各位好,我是初学者,我有一个很困惑的问题,请帮忙解决一下好吗?
- 如何实现用鼠标拖着一个图片在窗体内移动,想当空接龙那样的效果!
- ??????? 救命呀!!! 为什么我的jBuilder进不去了 ?????????
- 紧急求助!!!!
- Juilder6注册!将license key粘贴以后,它不停的让你重新选择have serial number和license key!
试改为
if(rsArticle.next()!=null)
试试吧
改为
ResultSet rsArticle=mydb.executeQuery("Select * from article where newsrid="+"'"+sID+"'");
该种方法不行,我试过,结果还是如此。
二:if(rsArticle!=null)
试改为
if(rsArticle.next()!=null)
试试吧
该种方法肯定行不通,因为rsArticle.next()返回的是boolean值,改为if(rs.next()!=false)还是出现同样的结果,真是奇怪???
你的SQL语句有问题Select * from article where newsrid='"+sID+"'
问题的的根源在于我没有关闭记录集及数据库连接,问题找到了,解决方法也就有了,就是及时关闭记录记录集和数据库连接。
check,please