org.springbyexample.jdbc.datasource
Class InitializingDriverManagerDataSource

java.lang.Object
  extended by org.springframework.jdbc.datasource.AbstractDataSource
      extended by org.springframework.jdbc.datasource.DriverManagerDataSource
          extended by org.springbyexample.jdbc.datasource.InitializingDriverManagerDataSource
All Implemented Interfaces:
DataSource, InitializingBean
Direct Known Subclasses:
HsqldbInitializingDriverManagerDataSource

public class InitializingDriverManagerDataSource
extends DriverManagerDataSource
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:
DriverManagerDataSource, SqlScriptProcessor

Field Summary
protected  SqlScriptProcessor sqlScriptProcessor
           
 
Fields inherited from class org.springframework.jdbc.datasource.AbstractDataSource
logger
 
Constructor Summary
InitializingDriverManagerDataSource()
           
 
Method Summary
 void afterPropertiesSet()
          Implementation of InitializingBean
 void setSqlScriptProcessor(SqlScriptProcessor sqlScriptProcessor)
          Sets SQL script processor.
 
Methods inherited from class org.springframework.jdbc.datasource.DriverManagerDataSource
getConnection, getConnection, getConnectionFromDriverManager, getConnectionFromDriverManager, getConnectionFromDriverManager, getConnectionProperties, getDriverClassName, getPassword, getUrl, getUsername, setConnectionProperties, setDriverClassName, setPassword, setUrl, setUsername
 
Methods inherited from class org.springframework.jdbc.datasource.AbstractDataSource
getLoginTimeout, getLogWriter, isWrapperFor, setLoginTimeout, setLogWriter, unwrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sqlScriptProcessor

protected SqlScriptProcessor sqlScriptProcessor
Constructor Detail

InitializingDriverManagerDataSource

public InitializingDriverManagerDataSource()
Method Detail

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.