org.springbyexample.jdbc.datasource
Class InitializingBasicDataSource
java.lang.Object
org.apache.commons.dbcp.BasicDataSource
org.springbyexample.jdbc.datasource.InitializingBasicDataSource
- All Implemented Interfaces:
- DataSource, DisposableBean, InitializingBean
public class InitializingBasicDataSource
- extends BasicDataSource
- implements InitializingBean, DisposableBean
Initializing version of BasicDataSource
.
After the properties are set any database initialization scripts are run.
This is very useful for unit testing.
- Author:
- David Winterfeldt
- See Also:
BasicDataSource
,
SqlScriptProcessor
Fields inherited from class org.apache.commons.dbcp.BasicDataSource |
connectionPool, connectionProperties, dataSource, defaultAutoCommit, defaultCatalog, defaultReadOnly, defaultTransactionIsolation, driverClassName, initialSize, logWriter, maxActive, maxIdle, maxOpenPreparedStatements, maxWait, minEvictableIdleTimeMillis, minIdle, numTestsPerEvictionRun, password, poolPreparedStatements, testOnBorrow, testOnReturn, testWhileIdle, timeBetweenEvictionRunsMillis, url, username, validationQuery |
Methods inherited from class org.apache.commons.dbcp.BasicDataSource |
addConnectionProperty, close, createDataSource, getConnection, getConnection, getConnectionPool, getDefaultAutoCommit, getDefaultCatalog, getDefaultReadOnly, getDefaultTransactionIsolation, getDriverClassName, getInitialSize, getLogAbandoned, getLoginTimeout, getLogWriter, getMaxActive, getMaxIdle, getMaxOpenPreparedStatements, getMaxWait, getMinEvictableIdleTimeMillis, getMinIdle, getNumActive, getNumIdle, getNumTestsPerEvictionRun, getPassword, getRemoveAbandoned, getRemoveAbandonedTimeout, getTestOnBorrow, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, getUrl, getUsername, getValidationQuery, isAccessToUnderlyingConnectionAllowed, isPoolPreparedStatements, removeConnectionProperty, setAccessToUnderlyingConnectionAllowed, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setDriverClassName, setInitialSize, setLogAbandoned, setLoginTimeout, setLogWriter, setMaxActive, setMaxIdle, setMaxOpenPreparedStatements, setMaxWait, setMinEvictableIdleTimeMillis, setMinIdle, setNumTestsPerEvictionRun, setPassword, setPoolPreparedStatements, setRemoveAbandoned, setRemoveAbandonedTimeout, setTestOnBorrow, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setUrl, setUsername, setValidationQuery |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sqlScriptProcessor
protected SqlScriptProcessor sqlScriptProcessor
InitializingBasicDataSource
public InitializingBasicDataSource()
setSqlScriptProcessor
public void setSqlScriptProcessor(SqlScriptProcessor sqlScriptProcessor)
- Sets SQL script processor.
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Implementation of
InitializingBean
- Specified by:
afterPropertiesSet
in interface InitializingBean
- Throws:
Exception
destroy
public void destroy()
throws Exception
- Implementation of
DisposableBean
- Specified by:
destroy
in interface DisposableBean
- Throws:
Exception
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
throws SQLException
- Throws:
SQLException
unwrap
public <T> T unwrap(Class<T> iface)
throws SQLException
- Throws:
SQLException
Copyright © 2008 Spring by Example. All Rights Reserved.