뷰페이지 구성 에러 해결(2)

2023. 7. 28. 13:35·Project/ERP

우선 에러 페이지는 이러 했다.

MyBatisExceptionTranslator.translateExceptionIfPossible

 

즉, 데이터베이스와의 연동시 문제가 발생한 것이다. 

그래서 바로 properties로 가보았다.

 

# port setting
server.port=10000

spring.output.ansi.enabled=always

spring.thymeleaf.cache=false
spring.thymeleaf.prefix=classpath:templates/views/
spring.thymeleaf.suffix=.html
spring.thymeleaf.view-names=thymeleaf/*

spring.mvc.view.prefix=/WEB-INF/views/
spring.mvc.view.suffix=.jsp


# spring-jdbc ??? ?? ?? ??? ??? ?? ??
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/mysql?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul
spring.datasource.username=root
spring.datasource.password=secret

# MyBatis ??(mapper) ?? ?? ??
# src/main/resources ??? ??? ??
mybatis.mapper-locations=classpath:mapper/**/*.xml

# ?? ??? ??
# app.upload.path = upload

사용한 데이터베이스는 MySQL

tool은 DBeaver이다.

 

그동안 OracleDB와 SQLDeveloper만 사용해 오다가 처음으로 바꿔봤다. (새로

 

그리고 캡쳐는 못했지만 다른 에러페이지에서 이런 에러 내용이 있었다.

Table 'mysql.Erp_Comcode' doesn't exist 

 

이걸 보고 나는 테이블명이 Erp_Comcode이고, mapper.xml에 sql문도 대소문자 틀린 것 없이 잘 적었는데 왜 테이블명 앞에 자동으로 mysql. 을 붙이는가 하고 생각했다.

 

그래서 이래저래 구글링을 해봤는데 원하는 결과가 나오질 않던 와중에 찾은 해결법은

 

spring.datasource.url=jdbc:mysql://localhost:3306/mysql?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul

이 url에 있는 mysql부분을 자신의 데이터베이스명으로 적어줘야 하는 것이었다. 

즉, 나같은 경우에는 mysql이 아닌 erp로 바꿔서

 

# port setting
server.port=10000

spring.output.ansi.enabled=always

spring.thymeleaf.cache=false
spring.thymeleaf.prefix=classpath:templates/views/
spring.thymeleaf.suffix=.html
spring.thymeleaf.view-names=thymeleaf/*

spring.mvc.view.prefix=/WEB-INF/views/
spring.mvc.view.suffix=.jsp


# spring-jdbc ??? ?? ?? ??? ??? ?? ??
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/erp?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul
spring.datasource.username=root
spring.datasource.password=dnehd1008@

# MyBatis ??(mapper) ?? ?? ??
# src/main/resources ??? ??? ??
mybatis.mapper-locations=classpath:mapper/**/*.xml

# ?? ??? ??
# app.upload.path = upload

이렇게 변경을 했더니 에러없이 잘 해결이 되었다. ^^

저작자표시 (새창열림)

'Project > ERP' 카테고리의 다른 글

인사팀 기능구현(1)  (0) 2023.09.20
역할 분담  (0) 2023.09.20
뷰페이지 구성 에러 해결(1)  (0) 2023.07.28
뷰페이지 구성(2)  (0) 2023.07.28
뷰페이지 구성  (0) 2023.07.15
'Project/ERP' 카테고리의 다른 글
  • 인사팀 기능구현(1)
  • 역할 분담
  • 뷰페이지 구성 에러 해결(1)
  • 뷰페이지 구성(2)
whkim98
whkim98
꾸준히 내 것으로 만드는 게시글을 작성하자
  • whkim98
    내 일기장
    whkim98
  • 전체
    오늘
    어제
    • 분류 전체보기
      • JAVA
      • JavaScript
        • Node
        • React
      • PYTHON
      • GitHub
      • DJANGO
      • Project
        • Insty
        • ERP
      • Cloud
        • NAVER CLOUD Web DevOps
        • Public
      • 자격증
        • SQLD
        • 정보처리기사
        • ADsP
        • 리눅스마스터
        • AWS
      • 코딩테스트
        • 프로그래머스 Lv0
        • 프로그래머스 Lv1
      • Spring
      • Tools
        • Postman
        • eGov
      • WEB
      • CS
      • DevOps
  • 블로그 메뉴

    • 홈
    • GitHub
    • 방명록
  • 링크

    • GitHub
  • 공지사항

  • 인기 글

  • 태그

    CORS
    RDBMS
    코테
    gitbash
    SQLD
    Python
    annotation
    django
    AWS
    github
    spring
    js
    eGov
    jsp
    Java
    javascript
    Tomcat
    html
    코딩테스트
    git
    해시 암호화
    React
    프로그래머스
    Postman
    정보처리기사
    node
    AdSP
    web
    Cloud
    코딩
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
whkim98
뷰페이지 구성 에러 해결(2)
상단으로

티스토리툴바