Si, ma ti stai perdendo in un bicchier d'acqua:

potresti provare con

codice:
try {
          Statement st = connection.createStatement();
          String query = "SELECT * FROM tabella";
          ResultSet rs = st.executeQuery(query);
          righe = rs.last().getRow();
          rs.beforeFirst(); 
          value = new Object[righe][2];
          while(rs.next()){
                   value[i][0]=rs.getString("nome");
                   value[i][1]=rs.getString("cognome");
                   i++;
                  }                          
        }catch(SQLException je){}
Occhio che però certi recordset con certi database sono scorsi solo una volta, in avanti, per cui potresti ottenere un'eccezione in fase di esecuzione.

Alternativamente, potresti creare un Vector ed aggiungere al Vector una riga del recordset alla volta. Alla fine per sapere quante righe hai estratto usi il metodo size() di Vector.