SQLIntegrityConstraintViolationException : 무결성 제약 조건에 위배됩니다. 에러 해결

김지원·2022년 6월 29일
0

### SQL: INSERT INTO coupang_member.users(`email`, `password`, `name`, `contact`, `admin_flag`) VALUES (?, ?, ?, ?, ?) ### Cause: java.sql.SQLIntegrityConstraintViolationException: (conn=102) Column 'email' cannot be null ; (conn=102) Column 'email' cannot be null; nested exception is java.sql.SQLIntegrityConstraintViolationException: (conn=102) Column 'email' cannot be null
org.springframework.dao.DataIntegrityViolationException: 

coupang project 진행하는데 회원가입 insert에 문제가 생겼다.
분명히 이메일을 null아닌 값을 집어넣었음에도 불구하고 오류가 계속발생하였다.

  • UserController에서 sout으로 값을 출력해보았을 때 아무것도 넘어오지 않은 것으로 봐서 html을 들여다보았다.
<label class="input-container">
    <i class="icon fa-solid fa-envelope"></i>
    <span hidden>이메일</span>
    <input autofocus class="input" maxlength="50"  placeholder="아이디(이메일)" type="email">
</label>
  • 수정전
<label class="input-container">
    <i class="icon fa-solid fa-envelope"></i>
    <span hidden>이메일</span>
    <input autofocus class="input" maxlength="50" name="email" placeholder="아이디(이메일)" type="email">
</label>
  • 수정후
  • inputname= "email"을 적어주지 않아서 오류가 터졌던 것이였다.
profile
Software Developer : -)

0개의 댓글