• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Nullpointer with RowSet

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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()?

 
Lucas Moraes
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the question really that difficult? or I didn't explained clear enough?
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your explanation is fine. It seems like a bug in the driver, not something we can explain.
 
reply
    Bookmark Topic Watch Topic
  • New Topic