| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 |
- springboot mybatis
- mapper
- SpringBoot에러
- 405MethodNotAllowed
- SQL
- ApacheKafka
- KafkaFlink
- 실시간데이터처리
- ios
- mybatis
- SpringKafka
- KafkaProducer
- 맥북
- HttpRequestMethodNotSupportedException
- 400badrequest
- RestControllerAdvice
- springboot
- SpringBoot Security
- springboot jwt
- RequestMethodNotSupported
- VUE
- java17
- ControllerAdvice
- Spring
- SpringBootKafka
- 시스템설정
- ApacheFlink
- 백엔드개발
- java
- springboot예외처리
- Today
- Total
목록전체 글 (167)
생활기록부
Spring Boot MyBatis Invalid bound statement 원인과 해결 방법Spring Boot에서 MyBatis를 사용하다 보면 자주 만나는 오류 중 하나가 Invalid bound statement입니다.대표적인 오류 메시지는 다음과 같습니다.org.apache.ibatis.binding.BindingException:Invalid bound statement (not found):com.example.mybatis.mapper.UserMapper.findById이 오류는 쉽게 말하면 Java Mapper 메서드는 호출했는데 MyBatis가 실행할 SQL을 찾지 못했다는 의미입니다.대부분 다음 중 하나가 원인입니다.Mapper XML namespace가 틀림Mapper Method..
Spring Boot MyBatis @Mapper와 @MapperScan 차이Spring Boot에서 MyBatis를 사용할 때 Mapper Interface를 Spring Bean으로 등록해야 합니다.이때 가장 많이 사용하는 방법이 다음 두 가지입니다.@Mapper@MapperScan처음 MyBatis를 사용하는 경우 둘의 차이가 헷갈릴 수 있습니다.예를 들어 다음과 같은 오류가 발생할 수 있습니다.required a bean of type'com.example.mybatis.mapper.UserMapper'that could not be found또는 Mapper Interface를 만들었는데 Spring이 Bean으로 등록하지 못해 Service 생성 단계에서 애플리케이션 실행이 실패할 수도 있습니..
Spring Boot MyBatis Mapper XML 사용 방법Spring Boot에서 MyBatis를 사용할 때 SQL을 Java 코드에 직접 작성할 수도 있지만, 실무에서는 Mapper XML에 SQL을 분리해서 관리하는 방식을 많이 사용합니다.특히 SQL이 길어지거나 JOIN, 서브쿼리, 동적 조건이 많아지면 Annotation 방식보다 XML 방식이 읽기 쉽고 유지보수하기 편합니다.이번 글에서는 Spring Boot에서 MyBatis Mapper XML을 연결하고 다음 내용을 직접 실행해보겠습니다.Mapper Interface와 Mapper XML 연결namespace와 id 역할parameterTyperesultTyperesultMap#{} 파라미터 바인딩SELECT / INSERT / UPD..
Spring Boot MyBatis 연동 방법 - MySQL CRUD 예제Spring Boot에서 MySQL을 연동할 때 JPA 대신 MyBatis를 사용하는 프로젝트도 많습니다.MyBatis는 SQL을 직접 작성하기 때문에 복잡한 조회 쿼리가 많거나 기존 SQL을 활용해야 하는 시스템에서 사용하기 좋습니다.Spring Boot와 MyBatis를 처음 연결하면 다음과 같은 부분에서 오류가 자주 발생합니다.Mapper Bean을 찾을 수 없음Mapper XML을 찾을 수 없음Invalid bound statementMySQL Connection 실패SQL 문법 오류DTO와 조회 결과가 매핑되지 않음이번 글에서는 Spring Boot 프로젝트에 MyBatis와 MySQL을 연결하고 다음 CRUD API를 직..
