Is there any option to terminate the execution of query after 15 seconds?

54 views Asked by At
rs = pstmt.executeQuery();

I want to set timer exactly before the execute query for 15 seconds for that it should be terminated.

1

There are 1 answers

1
Sandeepa On

You can use this,

pstmt.setQueryTimeout(15);
rs = pstmt.executeQuery();