Class QueryExecutor

java.lang.Object
es.imim.DISGENET.database.QueryExecutor
All Implemented Interfaces:
Runnable

public class QueryExecutor extends Object implements 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 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 occurs
      InterruptedException - if interrupted by another thread
    • close

      public void close()
    • run

      public void run()
      Specified by:
      run in interface Runnable