Package org.postgresql
Class Driver.ConnectThread
java.lang.Object
org.postgresql.Driver.ConnectThread
- All Implemented Interfaces:
Runnable
- Enclosing class:
Driver
Perform a connect in a separate thread; supports getting the results from the original thread
while enforcing a login timeout.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final ResourceLock
private final Condition
private final Properties
private Connection
private Throwable
private final String
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
lock
-
lockCondition
-
url
-
props
-
result
-
resultException
-
abandoned
private boolean abandoned
-
-
Constructor Details
-
ConnectThread
ConnectThread(String url, Properties props)
-
-
Method Details
-
run
public void run() -
getResult
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
-