Please tell me how to randomly select a row from the database? Here is what I did
ResultSet r1 = (ResultSet) s1.executeQuery(select str from slovar where length(str) > 12); ResultSet r2 = (ResultSet) s1.executeQuery(select count( * ) from slovar); int kol = 0; while (r1.next()) { kol = r2.next(); } int randomStr = (int) Math.random() * kol + 1;
And how can I choose from line r1 with the number randomStr?