Top Description Constructors Methods
org.springframework.jdbc.datasource.init

public abstract Class DatabasePopulatorUtils

extends Object
Class Inheritance
Imports
java.sql.Connection, javax.sql.DataSource, org.springframework.dao.DataAccessException, org.springframework.jdbc.datasource.DataSourceUtils, org.springframework.util.Assert

Utility methods for executing a DatabasePopulator.
Authors
Juergen Hoeller, Oliver Gierke, Sam Brannen
Since
3.1

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
execute(DatabasePopulator
the DatabasePopulator to execute
populator
,
DataSource
the DataSource to execute against
dataSource
)

Execute the given DatabasePopulator against the given DataSource.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DatabasePopulatorUtilsback to summary
public DatabasePopulatorUtils()

Method Detail

executeback to summary
public static void execute(DatabasePopulator populator, DataSource dataSource) throws DataAccessException

Execute the given DatabasePopulator against the given DataSource.

As of Spring Framework 5.3.11, the Connection for the supplied DataSource will be committed if it is not configured for auto-commit and is not transactional.

Parameters
populator:DatabasePopulator

the DatabasePopulator to execute

dataSource:DataSource

the DataSource to execute against

Exceptions
DataAccessException:
if an error occurs, specifically a ScriptException
See Also
DataSourceUtils#isConnectionTransactional(Connection, DataSource)