|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.pavelvlasov.sql.ConnectionPerThreadDataSource
Maintains one connection per thread. Connection is allocated on first getConnection() call. Every next call increments use counter. Connection closes when it is not used (counter==0) and connectionCloseTimeout passed.
| Constructor Summary | |
ConnectionPerThreadDataSource(java.lang.ClassLoader classLoader,
java.lang.String driverClass,
java.lang.String dbURL,
java.lang.String user,
java.lang.String password,
Transaction initConnectionTransaction)
Constructor |
|
ConnectionPerThreadDataSource(java.lang.String driverClass,
java.lang.String dbURL,
java.lang.String user,
java.lang.String password,
Transaction initConnectionTransaction)
Constructor |
|
| Method Summary | |
protected void |
finalize()
|
java.sql.Connection |
getConnection()
|
java.sql.Connection |
getConnection(java.lang.String user,
java.lang.String password)
|
Transaction |
getInitConnectionTransaction()
|
int |
getLoginTimeout()
|
java.io.PrintWriter |
getLogWriter()
|
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(java.io.PrintWriter out)
|
void |
shutdown()
Closes all pooled (unused) connections and instructs connections being used to close immeidatly once they are released. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConnectionPerThreadDataSource(java.lang.String driverClass,
java.lang.String dbURL,
java.lang.String user,
java.lang.String password,
Transaction initConnectionTransaction)
throws java.lang.ClassNotFoundException
driverClass - dbURL - user - password -
java.lang.ClassNotFoundException
public ConnectionPerThreadDataSource(java.lang.ClassLoader classLoader,
java.lang.String driverClass,
java.lang.String dbURL,
java.lang.String user,
java.lang.String password,
Transaction initConnectionTransaction)
throws java.sql.SQLException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.ClassNotFoundException
driverClass - dbURL - user - password -
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException| Method Detail |
public int getLoginTimeout()
getLoginTimeout in interface javax.sql.DataSourcepublic void setLoginTimeout(int seconds)
setLoginTimeout in interface javax.sql.DataSource
public java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.DataSourcejava.sql.SQLException
public void setLogWriter(java.io.PrintWriter out)
throws java.sql.SQLException
setLogWriter in interface javax.sql.DataSourcejava.sql.SQLException
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException
public java.sql.Connection getConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic void shutdown()
java.sql.SQLException
protected void finalize()
throws java.lang.Throwable
java.lang.Throwablepublic Transaction getInitConnectionTransaction()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||