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
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.