Package es.imim.DISGENET.database
Class QueryExecutor
java.lang.Object
es.imim.DISGENET.database.QueryExecutor
- All Implemented Interfaces:
Runnable
This class defines the
executeQuery()
method,
which is similar to Statement.executeQuery()
method.
The difference is that this method can be interrupted by another thread.-
Constructor Summary
-
Method Summary
-
Constructor Details
-
QueryExecutor
public QueryExecutor()
-
-
Method Details
-
executeQuery
public ResultSet executeQuery(Statement statement, String query) throws SQLException, InterruptedException Executes an SQL query. The method can be interrupted by another thread at any moment.- Parameters:
statement
- the prepared statement for the query.query
- the query to run.- Returns:
ResultSet
if execution successful- Throws:
SQLException
- if a database error occursInterruptedException
- if interrupted by another thread
-
close
public void close() -
run
public void run()
-