|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.hammurapi.sql.ConnectionPerThreadDataSource
public class 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 |
setOwner(java.lang.Object owner)
Plugs the component into container and naming bus. |
void |
shutdown()
Closes all pooled (unused) connections and instructs connections being used to close immeidatly once they are released. |
void |
start()
Invoked by container before the first use. |
void |
stop()
Invoked by container when component is not needed anymore. |
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.DataSource
public void setLoginTimeout(int seconds)
setLoginTimeout
in interface javax.sql.DataSource
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.DataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
setLogWriter
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public void shutdown()
java.sql.SQLException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public Transaction getInitConnectionTransaction()
public void setOwner(java.lang.Object owner)
Component
setOwner
in interface Component
public void start() throws ConfigurationException
Component
start
in interface Component
ConfigurationException
public void stop() throws ConfigurationException
Component
stop
in interface Component
ConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |