接口 DatabasePopulator
public interface DatabasePopulator
Strategy used to populate, initialize, or clean up a database.- 从以下版本开始:
- 3.0
- 作者:
- Keith Donald, Sam Brannen
- 另请参阅:
ResourceDatabasePopulator
,DatabasePopulatorUtils
,DataSourceInitializer
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
populate(Connection connection)
Populate, initialize, or clean up the database using the provided JDBC connection.
方法详细资料
populate
void populate(Connection connection) throws SQLException, ScriptException
Populate, initialize, or clean up the database using the provided JDBC connection.Concrete implementations may throw an
SQLException
if an error is encountered but are strongly encouraged to throw a specificScriptException
instead. For example, Spring'sResourceDatabasePopulator
andDatabasePopulatorUtils
wrap allSQLExceptions
inScriptExceptions
.- 参数:
connection
- the JDBC connection to use to populate the db; already configured and ready to use; nevernull
- 抛出:
SQLException
- if an unrecoverable data access exception occurs during database populationScriptException
- in all other error cases- 另请参阅:
DatabasePopulatorUtils.execute(org.springframework.jdbc.datasource.init.DatabasePopulator, javax.sql.DataSource)