본문 바로가기

DATABASE

(5)
[DataBase] LEFT OUTER JOIN 사용 시 주의 사항 기존에는 기준 테이블은 변하지 않고 조인 조건에 맞는 행의 컬럼들이 기준 테이블에 추가 된다고 생각하고 사용하여 원하는 결과를 얻었다. LEFT OUTER JOIN은 기준 테이블의 각 행에 조인 조건에 맞는 행이 1개 이하일 경우를 전제로 하고있다. (조인되는 행이 없다면 null) 보통 외래키를 사용하여 조인하므로 문제가 발생하지 않았다. 하지만 기준 테이블의 행에 조인 되는 행이 2개 이상이 되면 중복 데이터가 발생 한다. 그렇게 되면 행이 중복 되어 원하는 결과를 얻을 수 없다. 중복을 제거하여 사용해야 한다. 중복 제거 방법 1.테이블간 제약 조건을 명확히 한다. 2. 조인 조건 추가 ( where or having ) 3. distinct 사용 - 시스템 부하 발생할 수 있음. 4. group ..
[Mybatis] ResultType(ResultClass) : ResultMap 차이점 https://mybatis.org/mybatis-3/sqlmap-xml.html mybatis – MyBatis 3 | Mapper XML Files Mapper XML Files The true power of MyBatis is in the Mapped Statements. This is where the magic happens. For all of their power, the Mapper XML files are relatively simple. Certainly if you were to compare them to the equivalent JDBC code, you would immedi mybatis.org Mybatis 공식 문서에 기재된 차이점. resultType The fully..
[Error] Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for mapper.saveData - mybatis, root-context.xml mapper선언 에러 DAO, DTO, VO 를 통한 Mybatis 연동 설정 중 에러 발생. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource[/WEB-INF/spring/root-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\Users\eclipse-workspace\.metadata\.plu..
[Error] Java Spring MVC + Mybatis + PostgreSQL - CannotGetJdbcConnectionException : DB연동 오류 Mybatis + PostgreSQL database error Exception ......nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.postgresql.util.PSQLException: ID,PW와 에러 내용 한글 깨져서 나옴. ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionExceptio..
[Error] Mybatis SqlSession 오류 - Cannot find class: 패키지명(package) Mapper.xml 에서 해당 경로의 패키지명을 찾지 못 했다는 에러 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resourc [/WEB-INF/spring/root-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\Users\~경로\Mapper.xml]'; nested exception..