• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which is faster?

 
Alok Pota
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a big dataset that I am scrollling thru using the ResultSet like this
while (rs.next()) {
...
if (canUpdate) {
//Update some rows
}
}
In order to update the rows I use JDBC 1.0
by creating a new statement and then updating it
Would it be faster to use JDBC 2.0 programmatic
updates to the result set using
rs.updateRow() method?
Any benchmarks?
I am guessing its faster using the JDBC 2.0 approach.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like the perfect excuse to implement and run the code from this article at O'Reilly. It defines and specifies a proxy for the JDBC classes and adds profiling functionality.
Now you can run the test and tell us the answer!
DOM
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic