@FunctionalInterface public interface DatabasePopulator
ResourceDatabasePopulator,
DatabasePopulatorUtils,
DataSourceInitializer| Modifier and Type | Method and Description |
|---|---|
void |
populate(Connection connection)
Populate, initialize, or clean up the database using the provided JDBC
connection.
|
void populate(Connection connection) throws SQLException, ScriptException
Warning: Concrete implementations should not close
the provided Connection.
Concrete implementations may throw an SQLException if
an error is encountered but are strongly encouraged to throw a
specific ScriptException instead. For example, Spring's
ResourceDatabasePopulator and DatabasePopulatorUtils wrap
all SQLExceptions in ScriptExceptions.
connection - the JDBC connection to use; already configured and
ready to use; never nullSQLException - if an unrecoverable data access exception occurs
while interacting with the databaseScriptException - in all other error casesDatabasePopulatorUtils.execute(org.springframework.jdbc.datasource.init.DatabasePopulator, javax.sql.DataSource)