当前位置: 技术问答>java相关
请大家看看这条语句有什么错?
来源: 互联网 发布时间:2015-01-11
本文导语: 由最后一条向后取出记录集的数据: Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:BookDB","",""); //******************************************************************** Statement stmt=con.createStatement(ResultSet.T...
由最后一条向后取出记录集的数据:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:BookDB","","");
//********************************************************************
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
//the problem is here!
//********************************************************************
ResultSet rs=stmt.executeQuery("select * from Book");
rs.afterLast();
while(rs.previous())
{...........}
该如何改正?请大家指出!谢谢!
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:BookDB","","");
//********************************************************************
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
//the problem is here!
//********************************************************************
ResultSet rs=stmt.executeQuery("select * from Book");
rs.afterLast();
while(rs.previous())
{...........}
该如何改正?请大家指出!谢谢!
|
rs.last();