Quote:
Originally posted by hado2003
Ok, I'm reading a lot of rows from a DB2 database on the mainframe
in a table of my Java program. During the loading, sometimes I want break off this with ESC Key or Button.
|
If I understand you correctly you want to interrupt the query issued though JDBC.
The thread that issues Statement.executeQuery() blocks until the method returns, therefore it is not possible to interrupt it from within the same thread. You could probably attempt to close the corresponding Statement from another thread (that responds to a key or button event) but results could be unpredictable.
On the other hand, once the executeQuery() method returns there's nothing to interrupt. You can close ResultSet and then Statement at any moment.