select * from usertable where usercode='username' and activeflag=y
其中username是从页面中取值的变量
其中username是从页面中取值的变量
解决方案 »
- 数据库设计表
- 如何在jpg图片上某个位置加上GIF小图片,并以流的形式返回到前台。
- 紧急求救:Servlet /mp threw load() exception
- <select></select>问题,麻烦帮我看看。
- 我的TOMCAT配置不起来 急啊!旋转365 裸身跪求一解(第2弹)
- 初学者关于StrutsTestCase的问题?
- 一个封装数据库的问题
- 我想买一本jsp的书,对jsp,我只是看过书,没有做过实际项目,请问大家,那本书比较好?
- jsp各位高手来看看,指点指点!我已经郁闷了好长时间了!
- 关于tomcat的配置问题!
- 请教JSP 程序 在后台发文章后生成静态html 源
- 研究过日志分类的大侠请进!
str="";
ResultSet rs=stmt.executeQuery(str);
怎么把select * from usertable where usercode='username' and activeflag=y赋给str?
activeflag=y 这有点问题。
str = "select * from usertable where usercode='username' " + activeflag=y
最后边不加"?
我试了好几次都不行
ResultSet rs=stmt.executeQuery(str);
activeflag=y 是sql变量还是其它?
首先坐好
比如这一句
String sql=="select * from usertable where usercode='"+username+"' and activeflag=y"
out.println(sql);去掉左右两边的双引号放到数据中去查一下就知道对错了一般username是数据库中的字段是字符串类型,y是整形
select * from usertable where usercode='123' and activeflag=y