Can we cance/stop a long running database query execution instantly so that we can do any another task.
As i know swing uses a single
thread i,e Event Dispatch Thread (EDT), But at the same time we can use Swingworker class for better use of UI. When we use Swingworker class the process goes to a different thread and our basic UI is not Frozen. Infact we can do another task. But what I want is I want to stop of cancel the execution of swingworker thread ( Because I that thread takes long time to execute). How can I do that??
I used ProgressMonitor and in the cancel option i canceled the task ( worker.cancel(true) also i closed the connection and statement for executing the database query using stmt.close() and conn.close() methods.
But it doesnot work.
Please write a sample code for me, How to cancel a long running database background process in a
Java Swing Program.
Thank You