I am trying to kill the current process/query which is running from long and taking long time to execute
- I want to do it with java servlets
- I have a query and i ran it on my system but sometimes it is taking too much of time to get executed
- What i am trying to do is to kill that query which is taking long time
- I have google it a lot and found some help like with
show processlist
command in MySQL i can list up all the process which are currently in my system - like this it populates in my razor Sql
- as you all can see in the image the process which is running has
stae=Sending data
so i want to kill that process with id where state=Sending data - as simply in my SQL command i can write
kill id
it will kill the process whose id i give - But i want to do this programmatically with java servlet code
- I don't know how to do that,i am stuck here for so long
Below is my servlet do-Get and do-Post
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
I just want to know how can i do it with with java code,please guide me anykind of help will be appreciated
This is the link i have found but not getting idea how to achieve that