Package org.springframework.batch.test
Class DataSourceInitializer
java.lang.Object
org.springframework.batch.test.DataSourceInitializer
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
public class DataSourceInitializer
extends Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Wrapper for a
Run this class to initialize a database in a running server process. Make sure the server is running first by launching the "hsql-server" from the
DataSource
that can run scripts on start up and shut
down. Use as a bean definition Run this class to initialize a database in a running server process. Make sure the server is running first by launching the "hsql-server" from the
hsql.server
project. Then you can right click in Eclipse and
Run As -> Java Application. Do the same any time you want to wipe the
database and start again.- Author:
- Dave Syer, Drummond Dawson, Mahmoud Ben Hassine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
destroy()
static void
Main method as convenient entry point.void
setDataSource
(DataSource dataSource) void
setDestroyScripts
(org.springframework.core.io.Resource[] destroyScripts) void
setIgnoreFailedDrop
(boolean ignoreFailedDrop) void
setInitScripts
(org.springframework.core.io.Resource[] initScripts)
-
Constructor Details
-
DataSourceInitializer
public DataSourceInitializer()
-
-
Method Details
-
main
Main method as convenient entry point.- Parameters:
args
- arguments to be passed to main.
-
destroy
public void destroy()- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
setInitScripts
public void setInitScripts(org.springframework.core.io.Resource[] initScripts) -
setDestroyScripts
public void setDestroyScripts(org.springframework.core.io.Resource[] destroyScripts) -
setDataSource
-
setIgnoreFailedDrop
public void setIgnoreFailedDrop(boolean ignoreFailedDrop)
-