Example usage for org.springframework.batch.core.repository.support JobRepositoryFactoryBean setDatabaseType

List of usage examples for org.springframework.batch.core.repository.support JobRepositoryFactoryBean setDatabaseType

Introduction

In this page you can find the example usage for org.springframework.batch.core.repository.support JobRepositoryFactoryBean setDatabaseType.

Prototype

public void setDatabaseType(String dbType) 

Source Link

Document

Sets the database type.

Usage

From source file:com.example.configuration.BatchConfiguration.java

public JobRepository getJobRepository() throws Exception {
    JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
    factory.setDataSource(config.dataSource());
    factory.setTransactionManager(transactionManager);
    factory.setLobHandler(lobHandler());
    factory.setDatabaseType(DatabaseType.fromMetaData(config.dataSource()).name());
    factory.setIsolationLevelForCreate("ISOLATION_DEFAULT");
    factory.afterPropertiesSet();//from w  w  w.j  a v  a2  s.co  m
    return (JobRepository) factory.getObject();
}