Java.sql.SQLException: Operação inválida para encaminhar apenas conjunto de resultados

ERRO REPORTADO:

java.sql.SQLException: Operação inválida para encaminhar apenas conjunto de resultados: first

QUE COISA É ESSA!

Coloca o erro todo e o trecho do código tb.
Só com isso fica difícil saber qual o problema.

Bom, estou copiando o javadoc abaixo, e ele diz o seguinte:
se você chamou o método first, mas criou o resultset com a opção padrão (sem passar parâmetro nenhum para createStatement, por exemplo), o erro vai ocorrer.

[i]

boolean first ( ) throws SQLException

Moves the cursor to the first row in this ResultSet object.

Returns:
true if the cursor is on a valid row; false if there are no rows in the result set
Exceptions:
SQLException if a database access error occurs or the result set type is TYPE_FORWARD_ONLY

A default ResultSet object is not updatable and has a cursor that moves forward only. Thus, it is possible to iterate through it only once and only from the first row to the last row. New methods in the JDBC 2.0 API make it possible to produce ResultSet objects that are scrollable and/or updatable. The following code fragment, in which con is a valid Connection object, illustrates how to make a result set that is scrollable and insensitive to updates by others, and that is updatable. See ResultSet fields for other options.

       Statement stmt = con.createStatement(
                                      ResultSet.TYPE_SCROLL_INSENSITIVE,
                                      ResultSet.CONCUR_UPDATABLE);
       ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
       // rs will be scrollable, will not show changes made by others,
       // and will be updatable

[/i]

try{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

				Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@999.999.999.9:1521:orcl", "user", "passwd");

				// Query the employee names
				Statement stmt = [b]conn.createStatement()[/b];
		        ResultSet rset = stmt.executeQuery("select * from algo_tst");
				// Print the name out

				int n_rcount = 0;
				int n_mod = 0;

				/*rset.last();
				n_rcount = rset.getRow();
				rset.first();
				while (rset.next()){
					n_rcount++;
				}

				rset.first();

*/
n_rcount = rset.getFetchSize();
document.newPage();

				Table table = new Table(3);
				table.setBorderWidth(1);

				n_mod = (int)(n_rcount/27);

				for (int i= 0; i <=n_mod;i++){
					Cell cell = new Cell("Relatório de lojas");
					cell.setHeader(true);
					cell.setColspan(3);
					table.addCell(cell);
					for(int j = 0 ; j < 10; i++){
						table.addCell(rset.getString("id"));
						table.addCell(rset.getString("nome"));
					rset.next();
					}
				document.add(table);

				}

			}catch(Exception e){
				   e.printStackTrace();
				   document.newPage();
				   para=new Paragraph("ERRO REPORTADO" + e ,smallFont);
		           para.setAlignment(para.ALIGN_CENTER);
                   document.add(para);

				//   out.println(e);
    		}

		document.close();

	 } catch (Exception e) {
	            e.printStackTrace();
	 }[b]

bom!!!
pelo jeito está dando erro nesse negocio de ir pra frente e pra traz!!

o que eu preciso declarar pra poder usar o
first();
e o last();

Estava com o mesmo problema ao usar o rs.first ou rs.last

Resolvi realmente usando a dica do colega acima

stmt = conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);

Abraços

Excelente, funcionou redondo aqui.
Como só iria fazer leitura, defini o terceiro parâmetro como ResultSet.CONCUR_READ_ONLY
[]'s
– DG