package com.cloudhandson.ddsbackoffice.config;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(BackofficeProperties.class)
public class AppConfig {

  @Bean
  DdsDatabaseDriver ddsDatabaseDriver() {
    return new DdsDatabaseDriver();
  }

  static final class DdsDatabaseDriver {

    DdsDatabaseDriver() {
      try {
        Class.forName("oracle.jdbc.OracleDriver");
      } catch (ClassNotFoundException e) {
        throw new IllegalStateException("Oracle JDBC 드라이버를 찾을 수 없습니다.", e);
      }
    }
  }
}
