|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibatis.common.jdbc.SimpleDataSource
public class SimpleDataSource
This is a simple, synchronous, thread-safe database connection pool.
REQUIRED PROPERTIES ------------------- JDBC.Driver JDBC.ConnectionURL JDBC.Username JDBC.Password Pool.MaximumActiveConnections Pool.MaximumIdleConnections Pool.MaximumCheckoutTime Pool.TimeToWait Pool.PingQuery Pool.PingEnabled Pool.PingConnectionsOlderThan Pool.PingConnectionsNotUsedFor Pool.QuietMode
Nested Class Summary | |
---|---|
static class |
SimpleDataSource.SimplePooledConnection
--------------------------------------------------------------------------------------- SimplePooledConnection --------------------------------------------------------------------------------------- |
Constructor Summary | |
---|---|
SimpleDataSource(java.util.Map props)
Constructor to allow passing in a map of properties for configuration |
Method Summary | |
---|---|
protected void |
finalize()
|
void |
forceCloseAll()
Closes all of the connections in the pool |
long |
getAverageCheckoutTime()
Getter for the average age of a connection checkout |
long |
getAverageOverdueCheckoutTime()
Getter for the average age of overdue connections |
long |
getAverageRequestTime()
Getter for the average time required to get a connection to the database |
long |
getAverageWaitTime()
Getter for the average time spent waiting for connections that were in use |
long |
getBadConnectionCount()
Getter for the number of invalid connections that were found in the pool |
long |
getClaimedOverdueConnectionCount()
Getter for the number of connections that were claimed before they were returned |
java.sql.Connection |
getConnection()
|
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
|
long |
getHadToWaitCount()
Getter for the number of requests that had to wait for connections that were in use |
int |
getHoldability()
|
java.lang.String |
getJdbcDriver()
Getter for the name of the JDBC driver class used |
java.lang.String |
getJdbcPassword()
Getter for the JDBC password used |
java.lang.String |
getJdbcUrl()
Getter of the JDBC URL used |
java.lang.String |
getJdbcUsername()
Getter for the JDBC user name used |
int |
getLoginTimeout()
|
java.io.PrintWriter |
getLogWriter()
|
java.io.Reader |
getNCharacterStream(int columnIndex)
|
java.io.Reader |
getNCharacterStream(java.lang.String columnLabel)
|
java.sql.NClob |
getNClob(int columnIndex)
|
java.sql.NClob |
getNClob(java.lang.String columnLabel)
|
java.lang.String |
getNString(int columnIndex)
|
java.lang.String |
getNString(java.lang.String columnLabel)
|
int |
getPoolMaximumActiveConnections()
Getter for the maximum number of active connections |
int |
getPoolMaximumCheckoutTime()
Getter for the maximum time a connection can be used before it *may* be given away again. |
int |
getPoolMaximumIdleConnections()
Getter for the maximum number of idle connections |
int |
getPoolPingConnectionsNotUsedFor()
If a connection has not been used in this many milliseconds, ping the database to make sure the connection is still good. |
int |
getPoolPingConnectionsOlderThan()
Getter for the age of connections that should be pinged before using |
java.lang.String |
getPoolPingQuery()
Getter for the query to be used to check a connection |
int |
getPoolTimeToWait()
Getter for the time to wait before retrying to get a connection |
long |
getRequestCount()
Getter for the number of connection requests made |
java.sql.RowId |
getRowId(int columnIndex)
|
java.sql.RowId |
getRowId(java.lang.String columnLabel)
|
java.sql.SQLXML |
getSQLXML(int columnIndex)
|
java.sql.SQLXML |
getSQLXML(java.lang.String columnLabel)
|
java.lang.String |
getStatus()
Returns the status of the connection pool |
boolean |
isClosed()
|
boolean |
isPoolPingEnabled()
Getter to tell if we should use the ping query |
boolean |
isWrapperFor(java.lang.Class arg0)
|
void |
setLoginTimeout(int loginTimeout)
|
void |
setLogWriter(java.io.PrintWriter logWriter)
|
java.lang.Object |
unwrap(java.lang.Class arg0)
|
static java.sql.Connection |
unwrapConnection(java.sql.Connection conn)
Unwraps a pooled connection to get to the 'real' connection |
void |
updateAsciiStream(int columnIndex,
java.io.InputStream x)
|
void |
updateAsciiStream(int columnIndex,
java.io.InputStream x,
long length)
|
void |
updateAsciiStream(java.lang.String columnLabel,
java.io.InputStream x)
|
void |
updateAsciiStream(java.lang.String columnLabel,
java.io.InputStream x,
long length)
|
void |
updateBinaryStream(int columnIndex,
java.io.InputStream x)
|
void |
updateBinaryStream(int columnIndex,
java.io.InputStream x,
long length)
|
void |
updateBinaryStream(java.lang.String columnLabel,
java.io.InputStream x)
|
void |
updateBinaryStream(java.lang.String columnLabel,
java.io.InputStream x,
long length)
|
void |
updateBlob(int columnIndex,
java.io.InputStream inputStream)
|
void |
updateBlob(int columnIndex,
java.io.InputStream inputStream,
long length)
|
void |
updateBlob(java.lang.String columnLabel,
java.io.InputStream inputStream)
|
void |
updateBlob(java.lang.String columnLabel,
java.io.InputStream inputStream,
long length)
|
void |
updateCharacterStream(int columnIndex,
java.io.Reader x)
|
void |
updateCharacterStream(int columnIndex,
java.io.Reader x,
long length)
|
void |
updateCharacterStream(java.lang.String columnLabel,
java.io.Reader reader)
|
void |
updateCharacterStream(java.lang.String columnLabel,
java.io.Reader reader,
long length)
|
void |
updateClob(int columnIndex,
java.io.Reader reader)
|
void |
updateClob(int columnIndex,
java.io.Reader reader,
long length)
|
void |
updateClob(java.lang.String columnLabel,
java.io.Reader reader)
|
void |
updateClob(java.lang.String columnLabel,
java.io.Reader reader,
long length)
|
void |
updateNCharacterStream(int columnIndex,
java.io.Reader x)
|
void |
updateNCharacterStream(int columnIndex,
java.io.Reader x,
long length)
|
void |
updateNCharacterStream(java.lang.String columnLabel,
java.io.Reader reader)
|
void |
updateNCharacterStream(java.lang.String columnLabel,
java.io.Reader reader,
long length)
|
void |
updateNClob(int columnIndex,
java.sql.NClob clob)
|
void |
updateNClob(int columnIndex,
java.io.Reader reader)
|
void |
updateNClob(int columnIndex,
java.io.Reader reader,
long length)
|
void |
updateNClob(java.lang.String columnLabel,
java.sql.NClob clob)
|
void |
updateNClob(java.lang.String columnLabel,
java.io.Reader reader)
|
void |
updateNClob(java.lang.String columnLabel,
java.io.Reader reader,
long length)
|
void |
updateNString(int columnIndex,
java.lang.String string)
|
void |
updateNString(java.lang.String columnLabel,
java.lang.String string)
|
void |
updateRowId(int columnIndex,
java.sql.RowId x)
|
void |
updateRowId(java.lang.String columnLabel,
java.sql.RowId x)
|
void |
updateSQLXML(int columnIndex,
java.sql.SQLXML xmlObject)
|
void |
updateSQLXML(java.lang.String columnLabel,
java.sql.SQLXML xmlObject)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleDataSource(java.util.Map props)
props
- - the configuration parametersMethod Detail |
---|
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
DataSource.getConnection()
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
DataSource.getConnection(java.lang.String, java.lang.String)
public void setLoginTimeout(int loginTimeout) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
CommonDataSource.setLoginTimeout(int)
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
CommonDataSource.getLoginTimeout()
public void setLogWriter(java.io.PrintWriter logWriter) throws java.sql.SQLException
setLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
CommonDataSource.setLogWriter(java.io.PrintWriter)
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
CommonDataSource.getLogWriter()
public int getPoolPingConnectionsNotUsedFor()
public java.lang.String getJdbcDriver()
public java.lang.String getJdbcUrl()
public java.lang.String getJdbcUsername()
public java.lang.String getJdbcPassword()
public int getPoolMaximumActiveConnections()
public int getPoolMaximumIdleConnections()
public int getPoolMaximumCheckoutTime()
public int getPoolTimeToWait()
public java.lang.String getPoolPingQuery()
public boolean isPoolPingEnabled()
public int getPoolPingConnectionsOlderThan()
public long getRequestCount()
public long getAverageRequestTime()
public long getAverageWaitTime()
public long getHadToWaitCount()
public long getBadConnectionCount()
public long getClaimedOverdueConnectionCount()
public long getAverageOverdueCheckoutTime()
public long getAverageCheckoutTime()
public java.lang.String getStatus()
public void forceCloseAll()
public static java.sql.Connection unwrapConnection(java.sql.Connection conn)
conn
- - the pooled connection to unwrap
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public int getHoldability() throws java.sql.SQLException
java.sql.SQLException
public java.io.Reader getNCharacterStream(int columnIndex) throws java.sql.SQLException
java.sql.SQLException
public java.io.Reader getNCharacterStream(java.lang.String columnLabel) throws java.sql.SQLException
java.sql.SQLException
public java.sql.NClob getNClob(int columnIndex) throws java.sql.SQLException
java.sql.SQLException
public java.sql.NClob getNClob(java.lang.String columnLabel) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getNString(int columnIndex) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getNString(java.lang.String columnLabel) throws java.sql.SQLException
java.sql.SQLException
public java.sql.RowId getRowId(int columnIndex) throws java.sql.SQLException
java.sql.SQLException
public java.sql.RowId getRowId(java.lang.String columnLabel) throws java.sql.SQLException
java.sql.SQLException
public java.sql.SQLXML getSQLXML(int columnIndex) throws java.sql.SQLException
java.sql.SQLException
public java.sql.SQLXML getSQLXML(java.lang.String columnLabel) throws java.sql.SQLException
java.sql.SQLException
public boolean isClosed() throws java.sql.SQLException
java.sql.SQLException
public void updateAsciiStream(int columnIndex, java.io.InputStream x, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateAsciiStream(int columnIndex, java.io.InputStream x) throws java.sql.SQLException
java.sql.SQLException
public void updateAsciiStream(java.lang.String columnLabel, java.io.InputStream x, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateAsciiStream(java.lang.String columnLabel, java.io.InputStream x) throws java.sql.SQLException
java.sql.SQLException
public void updateBinaryStream(int columnIndex, java.io.InputStream x, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateBinaryStream(int columnIndex, java.io.InputStream x) throws java.sql.SQLException
java.sql.SQLException
public void updateBinaryStream(java.lang.String columnLabel, java.io.InputStream x, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateBinaryStream(java.lang.String columnLabel, java.io.InputStream x) throws java.sql.SQLException
java.sql.SQLException
public void updateBlob(int columnIndex, java.io.InputStream inputStream, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateBlob(int columnIndex, java.io.InputStream inputStream) throws java.sql.SQLException
java.sql.SQLException
public void updateBlob(java.lang.String columnLabel, java.io.InputStream inputStream, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateBlob(java.lang.String columnLabel, java.io.InputStream inputStream) throws java.sql.SQLException
java.sql.SQLException
public void updateCharacterStream(int columnIndex, java.io.Reader x, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateCharacterStream(int columnIndex, java.io.Reader x) throws java.sql.SQLException
java.sql.SQLException
public void updateCharacterStream(java.lang.String columnLabel, java.io.Reader reader, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateCharacterStream(java.lang.String columnLabel, java.io.Reader reader) throws java.sql.SQLException
java.sql.SQLException
public void updateClob(int columnIndex, java.io.Reader reader, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateClob(int columnIndex, java.io.Reader reader) throws java.sql.SQLException
java.sql.SQLException
public void updateClob(java.lang.String columnLabel, java.io.Reader reader, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateClob(java.lang.String columnLabel, java.io.Reader reader) throws java.sql.SQLException
java.sql.SQLException
public void updateNCharacterStream(int columnIndex, java.io.Reader x, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateNCharacterStream(int columnIndex, java.io.Reader x) throws java.sql.SQLException
java.sql.SQLException
public void updateNCharacterStream(java.lang.String columnLabel, java.io.Reader reader, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateNCharacterStream(java.lang.String columnLabel, java.io.Reader reader) throws java.sql.SQLException
java.sql.SQLException
public void updateNClob(int columnIndex, java.sql.NClob clob) throws java.sql.SQLException
java.sql.SQLException
public void updateNClob(int columnIndex, java.io.Reader reader, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateNClob(int columnIndex, java.io.Reader reader) throws java.sql.SQLException
java.sql.SQLException
public void updateNClob(java.lang.String columnLabel, java.sql.NClob clob) throws java.sql.SQLException
java.sql.SQLException
public void updateNClob(java.lang.String columnLabel, java.io.Reader reader, long length) throws java.sql.SQLException
java.sql.SQLException
public void updateNClob(java.lang.String columnLabel, java.io.Reader reader) throws java.sql.SQLException
java.sql.SQLException
public void updateNString(int columnIndex, java.lang.String string) throws java.sql.SQLException
java.sql.SQLException
public void updateNString(java.lang.String columnLabel, java.lang.String string) throws java.sql.SQLException
java.sql.SQLException
public void updateRowId(int columnIndex, java.sql.RowId x) throws java.sql.SQLException
java.sql.SQLException
public void updateRowId(java.lang.String columnLabel, java.sql.RowId x) throws java.sql.SQLException
java.sql.SQLException
public void updateSQLXML(int columnIndex, java.sql.SQLXML xmlObject) throws java.sql.SQLException
java.sql.SQLException
public void updateSQLXML(java.lang.String columnLabel, java.sql.SQLXML xmlObject) throws java.sql.SQLException
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class arg0) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
public java.lang.Object unwrap(java.lang.Class arg0) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |