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.RunnablePerform 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 booleanabandonedprivate java.util.Propertiespropsprivate java.sql.Connectionresultprivate java.lang.ThrowableresultExceptionprivate java.lang.Stringurl
-
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.ConnectiongetResult(long timeout)Get the connection result from this (assumed running) thread.voidrun()
-
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
getResult
public java.sql.Connection getResult(long timeout) throws java.sql.SQLExceptionGet 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
-
-