org.springframework.jdbc.datasource.init

## Class CompositeDatabasePopulator

- java.lang.Object
- - org.springframework.jdbc.datasource.init.CompositeDatabasePopulator

All Implemented Interfaces:
  DatabasePopulator

    public class CompositeDatabasePopulator
    extends Object
    implements DatabasePopulator

`DatabasePopulator` implementation that delegates to a list of other DatabasePopulator implementations, executing all scripts.

Since:
  3.1
Author:
  Dave Syer, Juergen Hoeller

### Constructor Summary

Constructors
Constructor and Description
`CompositeDatabasePopulator()`

### Method Summary

Methods
`void` `addPopulators(DatabasePopulator... populators)` Add a populator to the list of delegates.
`void` `populate(Connection connection)` Populate the database using the JDBC connection provided.
`void` `setPopulators(DatabasePopulator... populators)` Specify a list of populators to delegate to.

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

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

### Constructor Detail

#### CompositeDatabasePopulator

    public CompositeDatabasePopulator()

### Method Detail

#### setPopulators

    public void setPopulators(DatabasePopulator... populators)

Specify a list of populators to delegate to.

#### addPopulators

    public void addPopulators(DatabasePopulator... populators)

Add a populator to the list of delegates.

#### populate

    public void populate(Connection connection)
                  throws SQLException

Description copied from interface: `DatabasePopulator`
Populate the database using the JDBC connection provided.

Specified by:
  `populate` in interface `DatabasePopulator`
Parameters:
  `connection` - the JDBC connection to use to populate the db; already configured and ready to use
Throws:
  `SQLException` - if an unrecoverable data access exception occurs during database population