首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

运用jdbc标签注入sql脚本

2012-06-30 
使用jdbc标签注入sql脚本jdbc:embedded-databasejdbc:script locationclasspath:schema.sql/jdbc:

使用jdbc标签注入sql脚本

<jdbc:embedded-database>  <jdbc:script location="classpath:schema.sql"/>  <jdbc:script location="classpath:test-data.sql"/></jdbc:embedded-database>


类中文件脚本:
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.H2)    .addScript("my-schema.sql")    .addScript("my-test-data.sql").build();db.shutdown();

热点排行