File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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?
Similar Threads
Why does a JDBC batch update return a -2
Programmatic updates in JDBC 2.0
JDBC vs DB2 Export - Performance
how to use Scrollable ResultSet on WebSphere 4.0
can the data fetching time be extended?