Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rollback database on button click  RSS feed

 
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: 3639
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!