Reputation: 9064
Let's say that I get a ResultSet which was queryed using joins from an sql database.
Is it better to use an sql statement to update the tables or insert new tuples/rows?
Or should i use the resultSet.update() function?
I just want to know the drawbacks associated with each as well as the preferred method of updating tables.
Upvotes: 1
Views: 570
Reputation: 100706
ResultSet will only be updatable if:
If both conditions are true, updates are likely to be more efficient when done this way as you're already holding a cursor to the item. Otherwise you'll need to create a new statement - be sure to use a PreparedStatement for that.
Upvotes: 2