org.springbyexample.jdbc.datasource
Class HsqldbInitializingDriverManagerDataSource

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

public class HsqldbInitializingDriverManagerDataSource
extends InitializingDriverManagerDataSource
implements InitializingBean

HSQL DB specific initializing DriverManagerDataSource. If values aren't set for driver class name, url, username, or password defaults for an in memory HSQL DB are used.

After the properties are set any database initialization scripts are run. This is very useful for unit testing.

Author:
David Winterfeldt
See Also:
DriverManagerDataSource

Field Summary
protected static String DRIVER_CLASS_NAME
           
protected static String PASSWORD
           
protected static String URL
           
protected static String USERNAME
           
 
Fields inherited from class org.springbyexample.jdbc.datasource.InitializingDriverManagerDataSource
sqlScriptProcessor
 
Fields inherited from class org.springframework.jdbc.datasource.AbstractDataSource
logger
 
Constructor Summary
HsqldbInitializingDriverManagerDataSource()
           
 
Method Summary
 void afterPropertiesSet()
          Implementation of InitializingBean
 
Methods inherited from class org.springbyexample.jdbc.datasource.InitializingDriverManagerDataSource
setSqlScriptProcessor
 
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

DRIVER_CLASS_NAME

protected static String DRIVER_CLASS_NAME

URL

protected static String URL

USERNAME

protected static String USERNAME

PASSWORD

protected static String PASSWORD
Constructor Detail

HsqldbInitializingDriverManagerDataSource

public HsqldbInitializingDriverManagerDataSource()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Implementation of InitializingBean

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class InitializingDriverManagerDataSource
Throws:
Exception


Copyright © 2008 Spring by Example. All Rights Reserved.