Package org.springframework.jdbc.datasource.init

# Class DatabasePopulatorUtils

java.lang.Object
org.springframework.jdbc.datasource.init.DatabasePopulatorUtils

public abstract class DatabasePopulatorUtils extends Object
Utility methods for executing a `DatabasePopulator`.

Since:
  3.1
Author:
  Juergen Hoeller, Oliver Gierke, Sam Brannen

## Constructor Summary

Constructors
Constructor
Description
`DatabasePopulatorUtils()`

## Method Summary

Modifier and Type
Method
Description
`static void`
`execute(DatabasePopulator populator, DataSource dataSource)`
Execute the given `DatabasePopulator` against the given `DataSource`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DatabasePopulatorUtils

public DatabasePopulatorUtils()

## Method Details

### execute

public static void execute(DatabasePopulator populator, DataSource dataSource) throws org.springframework.dao.DataAccessException
Execute the given `DatabasePopulator` against the given `DataSource`.

The `Connection` for the supplied `DataSource` will be committed if it is not configured for `auto-commit` and is not transactional.

Parameters:
  `populator` - the `DatabasePopulator` to execute
  `dataSource` - the `DataSource` to execute against
Throws:
  `org.springframework.dao.DataAccessException` - if an error occurs, specifically a `ScriptException`
See Also:
  - `DataSourceUtils.isConnectionTransactional(Connection, DataSource)`