org.springbyexample.jdbc.datasource
Class InitializingDriverManagerDataSource
java.lang.Object
org.springframework.jdbc.datasource.AbstractDataSource
org.springframework.jdbc.datasource.AbstractDriverBasedDataSource
org.springframework.jdbc.datasource.SimpleDriverDataSource
org.springbyexample.jdbc.datasource.InitializingDriverManagerDataSource
- All Implemented Interfaces:
- DataSource, InitializingBean
- Direct Known Subclasses:
- HsqldbInitializingDriverManagerDataSource
public class InitializingDriverManagerDataSource
- extends SimpleDriverDataSource
- implements InitializingBean
Initializing version of DriverManagerDataSource
.
After the properties are set any database initialization scripts are run.
This is very useful for unit testing.
- Author:
- David Winterfeldt
- See Also:
SimpleDriverDataSource
,
SqlScriptProcessor
Methods inherited from class org.springframework.jdbc.datasource.AbstractDriverBasedDataSource |
getConnection, getConnection, getConnectionFromDriver, getConnectionProperties, getPassword, getUrl, getUsername, setConnectionProperties, setPassword, setUrl, setUsername |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
driverClassName
protected String driverClassName
sqlScriptProcessor
protected SqlScriptProcessor sqlScriptProcessor
InitializingDriverManagerDataSource
public InitializingDriverManagerDataSource()
setDriverClassName
public void setDriverClassName(String driverClassName)
- Sets driver class name. The class should implement
java.sql.Driver
. This is a shortcut for
calling setDriver(Driver driver)
on the parent class.
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
Copyright © 2008 Spring by Example. All Rights Reserved.