Java Code Examples for org.springframework.boot.jdbc.DatabaseDriver#ORACLE

The following examples show how to use org.springframework.boot.jdbc.DatabaseDriver#ORACLE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SkipperFlywayConfigurationCustomizer.java    From spring-cloud-skipper with Apache License 2.0 6 votes vote down vote up
@Override
public void customize(FluentConfiguration configuration) {
	// boot's flyway auto-config doesn't allow to define callbacks per
	// vendor id, so essentially customizing those here.
	DataSource dataSource = configuration.getDataSource();
	DatabaseDriver databaseDriver = getDatabaseDriver(dataSource);
	logger.info("Customizing flyway config, detected DatabaseDriver as {}.", databaseDriver);
	if (databaseDriver == DatabaseDriver.POSTGRESQL) {
		configuration.callbacks(new PostgresBeforeBaseline());
	}
	else if (databaseDriver == DatabaseDriver.MYSQL || databaseDriver == DatabaseDriver.MARIADB) {
		configuration.callbacks(new MysqlBeforeBaseline());
	}
	else if (databaseDriver == DatabaseDriver.SQLSERVER) {
		configuration.callbacks(new MsSqlBeforeBaseline());
	}
	else if (databaseDriver == DatabaseDriver.ORACLE) {
		configuration.callbacks(new OracleBeforeBaseline());
	}
	else if (databaseDriver == DatabaseDriver.DB2) {
		configuration.callbacks(new Db2BeforeBaseline());
	}
}
 
Example 2
Source File: DataFlowFlywayConfigurationCustomizer.java    From spring-cloud-dataflow with Apache License 2.0 6 votes vote down vote up
@Override
public void customize(FluentConfiguration configuration) {
	// boot's flyway auto-config doesn't allow to define callbacks per
	// vendor id, so essentially customizing those here.
	DataSource dataSource = configuration.getDataSource();
	DatabaseDriver databaseDriver = getDatabaseDriver(dataSource);
	if (databaseDriver == DatabaseDriver.POSTGRESQL) {
		configuration.callbacks(new PostgresBeforeBaseline());
	}
	else if (databaseDriver == DatabaseDriver.MYSQL || databaseDriver == DatabaseDriver.MARIADB) {
		configuration.callbacks(new MysqlBeforeBaseline());
	}
	else if (databaseDriver == DatabaseDriver.SQLSERVER) {
		configuration.callbacks(new MsSqlBeforeBaseline());
	}
	else if (databaseDriver == DatabaseDriver.ORACLE) {
		configuration.callbacks(new OracleBeforeBaseline());
	}
	else if (databaseDriver == DatabaseDriver.DB2) {
		configuration.callbacks(new Db2BeforeBaseline());
	}
}