• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to delete a ResultSet row without deleting the underlying database row?

 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how I can delete a ResultSet row without deleting the underlying database row?

The ResultSet docs say deleteRow() also deletes the row from the underlying database, so I'm hoping someone can suggest another way.

Cheers,
James
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36014
423
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James,
A ResultSet is tied to the database. Normally, you make a copy if you just want to store the data locally. You could use a disconnected resultset (or rowset), but you would need to be very careful to never re-connect it because then the database would be affected.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65664
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then why do you feel a need to delete the resultset?
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi James Hodgkiss

you question is not clear because if you dont want to delete row from database then why you need to do it. What is the reason? Because now i think by telling us your reason would help us to find the better way for you and solve your problem.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!