|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xorm.datastore.sql.PooledDataSource
Wraps a JDBC driver manager and provides a pooling of connections.
Field Summary | |
protected LinkedList |
availableConnections
|
protected int |
connCount
|
protected Driver |
driver
|
protected Properties |
props
|
Constructor Summary | |
PooledDataSource()
Initializes a new pooled data source |
Method Summary | |
void |
close()
Releases all available connections. |
protected void |
dropConnection(org.xorm.datastore.sql.PooledConnection conn)
remove a connection from the pool |
boolean |
getCheckReturnedConnection()
If set, instructs the connection to verify its valid when the caller is done with the connection (calls close). |
Connection |
getConnection()
Gets a DB connection, actually a wrapper that allows the connection to be pooled. |
Connection |
getConnection(String userName,
String password)
This function is currently not implemented as it doesn't allow us to use the connections in the pool. |
String |
getConnectionUrl()
|
String |
getDriverName()
|
long |
getIdleCheck()
Gets the amount of time in milliseconds a connection has been idle before the pool tests the connection to see if its still valid |
String |
getIdleCheckSQL()
Gets a sql statement to be used to check a connection. |
Integer |
getIsolationLevel()
|
int |
getLoginTimeout()
|
PrintWriter |
getLogWriter()
The PooledDataSource class uses JDK 1.4 logging and ignores the log writer. |
int |
getMaxPool()
The maximum number of connections created by the data source. |
int |
getMinPool()
The minimum number of connections in the pool. |
String |
getUser()
|
protected void |
makeAvailable(org.xorm.datastore.sql.PooledConnection conn)
Makes the connection available again. |
void |
setCheckReturnedConnection(boolean value)
If set, instructs the connection to verify its valid when the caller is done with the connection (calls close). |
void |
setConnectionUrl(String s)
Set the URL used to connect to the DB |
void |
setDriverName(String s)
Set the name of the driver to load when connecting to the DB |
void |
setIdleCheck(long idle)
Sets the amount of time in milliseconds a connection has been idle before the pool tests the connection to see if its still valid |
void |
setIdleCheckSQL(String sql)
Sets a sql statement to be used to check a connection. |
void |
setIsolationLevel(Integer isolationLevel)
Sets the transaction isolation level. |
void |
setLoginTimeout(int timeout)
Sets the maximum time to wait in seconds for a connection before throwing an exception. |
void |
setLogWriter(PrintWriter logger)
|
void |
setMaxPool(int i)
|
void |
setMinPool(int i)
|
void |
setPassword(String s)
Sets the password to use when creating a db connection. |
void |
setUser(String s)
Sets the user name to pass when making a db connection |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Properties props
protected int connCount
protected Driver driver
protected LinkedList availableConnections
Constructor Detail |
public PooledDataSource()
Method Detail |
public void setUser(String s)
public String getUser()
public void setPassword(String s)
public void setConnectionUrl(String s)
public String getConnectionUrl()
public void setDriverName(String s)
public String getDriverName()
public int getMaxPool()
public void setMaxPool(int i)
public int getMinPool()
public void setMinPool(int i)
public int getLoginTimeout()
getLoginTimeout
in interface DataSource
public void setLoginTimeout(int timeout)
setLoginTimeout
in interface DataSource
public boolean getCheckReturnedConnection()
public void setCheckReturnedConnection(boolean value)
public long getIdleCheck()
public void setIdleCheck(long idle)
public String getIdleCheckSQL()
public void setIdleCheckSQL(String sql)
public void setIsolationLevel(Integer isolationLevel)
public Integer getIsolationLevel()
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String userName, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public PrintWriter getLogWriter()
getLogWriter
in interface DataSource
public void setLogWriter(PrintWriter logger)
setLogWriter
in interface DataSource
protected void makeAvailable(org.xorm.datastore.sql.PooledConnection conn)
public void close()
protected void dropConnection(org.xorm.datastore.sql.PooledConnection conn)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |