This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Which is faster? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Which is faster?" Watch "Which is faster?" New topic

Which is faster?

Alok Pota
Ranch Hand

Joined: Mar 07, 2001
Posts: 185
I have a big dataset that I am scrollling thru using the ResultSet like this
while ( {
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

Joined: Mar 06, 2001
Posts: 13459

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!
I agree. Here's the link:
subject: Which is faster?
It's not a secret anymore!