Hi everybody, I'm currently studying for the OCPJP 7 and I'm programming some JDBC classes, It was all ok until I found this strange bug and want to know why is this happening.
The situation is as follows:
I have this class TestRowSet.java:
but I'm getting a nullpointer when the code reaches row.first() method, and if I remove this line the nullpointer is at row.next() instead, as if there is no resultset object anymore after the commit method.
if I remove the row.commit method, the code prints fine(only doesn't save anything on the database) , and strangest yet is that I have a similar class using the plain old ResultSet instead:
But this class runs fine, so I'm wondering, what is wrong in the rowset class? is there any difference between Connection.commit() and JdbcRowSet.commit()?
posted 3 years ago
Is the question really that difficult? or I didn't explained clear enough?