关于获取记录总数的方法!!!不是小白问题 我的语句是这样:select distinct 项目 from con在这种情况下,GETROW无法正常获取我想要的结果,求教~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 例如我的记录是这样:学号 项目 123 ABC 1234 ABC 14 AC 145 ACselect distinct 项目 from con结果显示数据有4条,而且while(rs.next())会发生java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 无效的游标状态 也就是越界了~~ select distinct cout(xx) ..... 我用VB试这个语句很正常,也就是记录数是2,但JSP不知怎么了..JSP有获取记录数的函数么 try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}catch(ClassNotFoundException e){ out.print(e);}String strDirPath=application.getRealPath(request.getRequestURI()); strDirPath=strDirPath.substring(0,strDirPath.lastIndexOf('\\'))+"\\"; String url = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ="+strDirPath+"eischool.mdb";//out.print(url);Connection conn=DriverManager.getConnection(url);Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);ResultSet rs=stmt.executeQuery("select distinct 项目 from conrs.last();int rsc=rs.getRow(); 或者用 out.print(rs.getString(1));当正常显示出ABC AC后就发生游标错误 select distinct count(xx)...更加不正确 试试:if(rs!=null) int row=rs.getrow();应该是rs.last();的问题 在我印象中select distinct 项目 from con是忽略重的记录后,取出的记录数select count(*) from con 是返回所有的记录数 mail.jar nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.Persiste 分页查询问题 在线等 这个select怎么改啊 JSTL Table 中如何动态增行 什么叫水晶报表 请教问题,请大家近来看看 如何用JSP做一个树型结构? spring AOP注解方式与xml方式不同点 eclipse连接oracle问题(hibernate)] 下载时Jsp页面自己关闭后,才出现下载的对话框
123 ABC
1234 ABC
14 AC
145 AC
select distinct 项目 from con
结果显示数据有4条,而且while(rs.next())会发生
java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 无效的游标状态
也就是越界了~~
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e){
out.print(e);
}
String strDirPath=application.getRealPath(request.getRequestURI());
strDirPath=strDirPath.substring(0,strDirPath.lastIndexOf('\\'))+"\\";
String url = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ="+strDirPath+"eischool.mdb";
//out.print(url);Connection conn=DriverManager.getConnection(url);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);ResultSet rs=stmt.executeQuery("select distinct 项目 from conrs.last();
int rsc=rs.getRow(); 或者用 out.print(rs.getString(1));当正常显示出ABC AC后就发生游标错误
应该是rs.last();的问题
select count(*) from con 是返回所有的记录数