List<Book> list = new ArrayList<Book>();
Connection con = DBConnection.getCon();
//String sql = "select top ? * from bookInformation where id not in (select top ? id from bookInformation)";
//String sql = "select top 9 * from bookInformation ";
String sql = "select top + Book.PAGE_SIZE from bookInformation where id not in (select top (page-1)*Book.PAGE_SIZE id from bookInformation)";
try{
PreparedStatement stmt = con.prepareStatement(sql);
stmt.setInt(1,Book.PAGE_SIZE); //设置查询数据所返回的记录数
stmt.setInt(2,(page-1)*Book.PAGE_SIZE); //设置查询记录的开始位置
ResultSet rst = stmt.executeQuery();
上面是代码,出现了索引超出范围的错误。请大家帮我解决一下?非常感谢