public class DataSourceInitializer
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
DataSource
that can run scripts on start up and shut
down. Use as a bean definition 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.Constructor and Description |
---|
DataSourceInitializer() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
static void |
main(java.lang.String... args)
Main method as convenient entry point.
|
void |
setDataSource(javax.sql.DataSource dataSource) |
void |
setDestroyScripts(org.springframework.core.io.Resource[] destroyScripts) |
void |
setIgnoreFailedDrop(boolean ignoreFailedDrop) |
void |
setInitScripts(org.springframework.core.io.Resource[] initScripts) |
public static void main(java.lang.String... args)
args
- arguments to be passed to main.public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public void setInitScripts(org.springframework.core.io.Resource[] initScripts)
public void setDestroyScripts(org.springframework.core.io.Resource[] destroyScripts)
public void setDataSource(javax.sql.DataSource dataSource)
public void setIgnoreFailedDrop(boolean ignoreFailedDrop)