• Post Reply Bookmark Topic Watch Topic
  • New Topic

rollback database on button click

 
pourush rohila
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone

how we create a swing application with 2 buttons named delete and rollback, when click on delete button data should be deleted from database and when we click on rollback button then it rollback deleted data
 
K. Tsang
Bartender
Posts: 3610
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you are doing a undo command.

From DB perspective, once the transaction is committed, technically it can't be rolled back. A new insert is needed.

However if you control the commit level, when you click the delete button BUT don't commit, then technically you CAN roll back by click the "rollback" button. But then when will you commit to make the delete permanent? Because if you say refresh your data, those deleted data may still be there.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!