Class Driver.ConnectThread

java.lang.Object
org.postgresql.Driver.ConnectThread
All Implemented Interfaces:
Runnable
Enclosing class:
Driver

private static class Driver.ConnectThread extends Object implements Runnable
Perform a connect in a separate thread; supports getting the results from the original thread while enforcing a login timeout.
  • Field Details

    • url

      private final String url
    • props

      private final Properties props
    • result

      private Connection result
    • resultException

      private Throwable resultException
    • abandoned

      private boolean abandoned
  • Constructor Details

  • Method Details

    • run

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

      public Connection getResult(long timeout) throws SQLException
      Get the connection result from this (assumed running) thread. If the timeout is reached without a result being available, a SQLException is thrown.
      Parameters:
      timeout - timeout in milliseconds
      Returns:
      the new connection, if successful
      Throws:
      SQLException - if a connection error occurs or the timeout is reached