Package org.postgresql
Class Driver.ConnectThread
- java.lang.Object
-
- org.postgresql.Driver.ConnectThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- Driver
private static class Driver.ConnectThread extends java.lang.Object implements java.lang.Runnable
Perform a connect in a separate thread; supports getting the results from the original thread while enforcing a login timeout.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
abandoned
private java.util.Properties
props
private java.sql.Connection
result
private java.lang.Throwable
resultException
private java.lang.String
url
-
Constructor Summary
Constructors Constructor Description ConnectThread(java.lang.String url, java.util.Properties props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.sql.Connection
getResult(long timeout)
Get the connection result from this (assumed running) thread.void
run()
-
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
getResult
public java.sql.Connection getResult(long timeout) throws java.sql.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:
java.sql.SQLException
- if a connection error occurs or the timeout is reached
-
-