Class CreateDatabasePopulator

  • All Implemented Interfaces:
    org.springframework.jdbc.datasource.init.DatabasePopulator

    public class CreateDatabasePopulator
    extends Object
    implements org.springframework.jdbc.datasource.init.DatabasePopulator
    Create a new database and drop an existing one if desired.

    This populator needs to be run with a data source that has been passed through BootstrappedDataSourceFactory, because the database might not exist.

    Author:
    poirigui
    See Also:
    BootstrappedDataSourceFactory
    • Constructor Detail

      • CreateDatabasePopulator

        public CreateDatabasePopulator​(String databaseName)
    • Method Detail

      • populate

        public void populate​(Connection connection)
                      throws SQLException
        Specified by:
        populate in interface org.springframework.jdbc.datasource.init.DatabasePopulator
        Throws:
        SQLException
      • setDropIfExists

        public void setDropIfExists​(boolean dropIfExists)