我用
<%//数据库已经连接上
String check = new String(request.getParameter("check").getBytes("ISO8859_1"),"GBK");
sql = "select count(*) as total from students where sfjf=1 and grade=?";
PreparedStatement ps =conn.prepareStatement(sql); ps.setBytes(1,check.getBytes("GB2312")); rs =ps.executeQuery();
%>
我读取结果集中的数据时用:
<%=rs.getInt("total")%>
但是提示有错,这是怎么回事?
应该如何读取呀?
<%//数据库已经连接上
String check = new String(request.getParameter("check").getBytes("ISO8859_1"),"GBK");
sql = "select count(*) as total from students where sfjf=1 and grade=?";
PreparedStatement ps =conn.prepareStatement(sql); ps.setBytes(1,check.getBytes("GB2312")); rs =ps.executeQuery();
%>
我读取结果集中的数据时用:
<%=rs.getInt("total")%>
但是提示有错,这是怎么回事?
应该如何读取呀?
解决方案 »
- 7月份就要实习了,请有工作经验的前辈衡量下这样的一个“我”能否找到工作??
- 关于Hibernate全文检索的问题
- 求一触发器,,,急!!!!!11
- 大家好,我初学java,对很多技术不是很了解,只浅知struts、spring、hibernate、taglib等,看了一些资料,但是不知道应该从和学起,请高
- 关于weblogic的问题 急 跪求各位帮帮忙
- Struts2表单提交后没有进入action的痕迹
- 我风了,谁帮帮我
- jsp+ms sql server 2000
- 在jsp网页中如何向javabean传递HttpServletResponse参数,在线等待,高分相送
- 初学者的苦恼
- 如何提取FCKEditor中上传图片的地址?
- JBuilder2006+Weblogic9+SQLServer2005配置时出现问题
<%=rs.getInt("total")%>
所以要执行下 rs.next()
......
ps.setBytes(1,check);