Problem with SQL, ResultSet in java

Posted by aphex on Stack Overflow See other posts from Stack Overflow or by aphex
Published on 2010-03-30T13:29:29Z Indexed on 2010/03/30 13:33 UTC
Read the original article Hit count: 382

Filed under:
|
|

How can I iterate ResultSet ? I've tried with the following code, but i get the error java.sql.SQLException: Illegal operation on empty result set.

                while ( !rs.isLast()) {
                rs.next();
                int id = rs.getInt("person_id");
                SQL.getInstance().getSt().execute("INSERT ref_person_pub(person_id) VALUES(" + id + ")");
            }

© Stack Overflow or respective owner

Related posts about java

Related posts about mysql-query