Class PostgreConfig


  • @Configuration
    @PropertySource("classpath:properties/db.properties")
    @EnableTransactionManagement
    public class PostgreConfig
    extends java.lang.Object
    PostgreSQL JDBC 설정(xml 대체)
    Version:
    1.0
    Author:
    Yeonhee Kim
    • Constructor Summary

      Constructors 
      Constructor Description
      PostgreConfig()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.sql.DataSource dataSource()
      JDBC 입력 값
      org.apache.ibatis.session.SqlSession sqlSession()
      SqlSession을 반환함
      org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory()
      SqlSession을 만들기 위해 SQL Mapper xml 경로가 지정된 SqlSessionFactory 리턴
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PostgreConfig

        public PostgreConfig()
    • Method Detail

      • dataSource

        @Bean("dataSource")
        public javax.sql.DataSource dataSource()
        JDBC 입력 값
        Returns:
        PostgreSQL의 JDBC 정보 반환
      • sqlSessionFactory

        @Bean
        public org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory()
                                                                      throws java.lang.Exception
        SqlSession을 만들기 위해 SQL Mapper xml 경로가 지정된 SqlSessionFactory 리턴
        Returns:
        SqlSessionFacotry를 리턴
        Throws:
        java.lang.Exception - 예외처리
      • sqlSession

        @Bean
        public org.apache.ibatis.session.SqlSession sqlSession()
                                                        throws java.lang.Exception
        SqlSession을 반환함
        Returns:
        SqlSession을 구현한 SqlSessionTemplate 반환
        Throws:
        java.lang.Exception - 예외처리