Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • 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
Marshal
Posts: 34837
369
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
Pie
Posts: 65105
89
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic