public class WrappingSimonDataSource extends AbstractSimonDataSource implements DataSource
<bean id="dataSource" class="org.javasimon.jdbcx.WrappingSimonDataSource">
<property name="dataSource" ref="pooledDataSource"/>
<property name="prefix" value="sky.batchpricer.skydb"/>
</bean>
<bean id="pooledDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="my.driver.class.Driver"/>
<property name="url" value="${mydb.url}"/>
<property name="initialSize" value="0"/>
<property name="maxActive" value="5"/>
<property name="maxIdle" value="2"/>
<property name="validationQuery" value="SELECT 1"/>
</bean>configuration, logWriter| Constructor and Description |
|---|
WrappingSimonDataSource() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
doGetRealDataSourceClassName()
Reads DataSource class name from configuration.
|
Connection |
getConnection()
Attempts to establish a connection with the data source that this
DataSource object represents. |
Connection |
getConnection(String user,
String password)
Attempts to establish a connection with the data source that this
DataSource object represents. |
DataSource |
getDataSource() |
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class<?> iface) |
void |
setDataSource(DataSource ds) |
<T> T |
unwrap(Class<T> iface) |
createDataSource, getLoginTimeout, getLogWriter, getPassword, getPrefix, getProperties, getRealDataSourceClassName, getRealUrl, getUrl, getUser, setLoginTimeout, setLogWriter, setPassword, setPrefix, setProperties, setRealDataSourceClassName, setUrl, setUserclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLoginTimeout, getLogWriter, setLoginTimeout, setLogWriterpublic WrappingSimonDataSource()
public DataSource getDataSource()
public void setDataSource(DataSource ds)
public Connection getConnection() throws SQLException
DataSource object represents.getConnection in interface DataSourceSQLException - if a database access error occurspublic Connection getConnection(String user, String password) throws SQLException
DataSource object represents.getConnection in interface DataSourceuser - the database user on whose behalf the connection is being madepassword - the user's passwordSQLException - if a database access error occurspublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionprotected String doGetRealDataSourceClassName()
AbstractSimonDataSourcedoGetRealDataSourceClassName in class AbstractSimonDataSourcepublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionCopyright © 2019. All rights reserved.