목록오류 (6)
개발새발
프로젝트 코드를 짜다가 org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement이런 오류를 만났다 진짜 몇시간을 찾아봤지만 고치지 못했다 하지만!!!!! 고쳤다 진짜 너무 멍청한 짓을 했던것이다 기존 코드 고친 코드 새로 작성된 comment가 insert되게 해야하는데 아무런 관련도 없고 빈 comment를 db에 넣으려고 하니까 생긴 에러였다 이런 오류는 주로 null 값을..
application.yml 파일과 application-oauth.yml 파일을 나눠서 사용했을때 한쪽만 spring을 붙이고 들여쓰기를 잘 해야된다
swagger를 적용하다가 만난 에러 yml 파일에 이렇게 추가해 줬다
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id=2' at line 1 이 에러는 하면안된다 이유는 ''표나 , 을 잘못 썼기 때문이다
StringIndexOutOfBoundsException 원인 : 300자가 안되는 문자열을 300자로 자르려고 해서 발생. 해결 : substing() 전 length 체크하는 코드 작성
ArrayList에서 인덱스 뽑기 첫번째 인덱스 ArrayList.size(); Int firstIndex = ArrayList.get(0); 마지막 인덱스 Int lastIndex = ArrayList.size() -1; sout ( ArrayList.get(lastIndex)); =================================================== LinkedList에 값 추가하기 add(index, value) ——> index를 생략하면 가장 마지막에 추가 addFirst(value)함수를 사용하여 가장 앞에 추가 addLast(value)함수를 사용하요 가장 뒤에 추가 LinkedList에 값 삭제하기 removeFirst() 메소드를 사용하면 가장 첫 데이터 remove..