티스토리 뷰
Programming/Spring
java.lang.RuntimeException: ResultSet.getXXX(colName): could not look up name
마음 부자 2020. 3. 10. 14:54반응형
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.RuntimeException: ResultSet.getXXX(colName): could not look up name
원인
java에서 database쿼리가 위에처럼 에러가 난다면 컬럼 이름이 지정됐는 지 확인해봐야한다.
항목의 이름을 가지고 올 수 없어서 나는 에러이다.
보통
select cont(*)
from copy
or
select cont(1)
from copy
or
select cont(no)
from copy
요렇게 쿼리문을 썼을 때 발생한다.
해결 :
에러가 나지 않게 이름을 지정해주자
select cont(*) as tot_count
from copy
or
select cont(1) as tot_count
from copy
or
select cont(no) as tot_count
from copy
반응형
'Programming > Spring' 카테고리의 다른 글
[eclipse] the specified jre installation does not exist 오류 (0) | 2020.07.16 |
---|---|
[java] Project facet java version 13 is not supported 간단 해결법 (0) | 2020.03.16 |
[java] substring으로 날짜, 시간 자르기 (yymmddhhmmss) (0) | 2020.02.06 |
[eclipse] Some problems were encountered while building the effective settings (0) | 2020.01.03 |
자바7(jdk1.7)버전에서 자바8(jdk1.8)버전으로 설치 (0) | 2019.12.31 |
댓글
반응형