ORA-12505 에러 해결방법
Oracle 데이터베이스를 JdbcTemplate를 이용하여 연동 할경우 발생하는 오류이다.
에러내용은 다음과 같다
메세지
Request processing failed; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Listener refused the connection with the following error:
근본원인
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
위의 내용을보면 리스너가 현재 제공된 SID의 값을 알수 없다고 한다.
servlet-context.xml에 jdbc:oracle:thin:@localhost:1521:orcl" url의 value값을 이렇게 작성하는것이 일반적이다.
이때 sqlDeveloper와 같은 데이터베이스 관리 프로그램을 열어 확인해보면 오라클의 경우 보통 SID에 xe를 많이 사용한다.
이때 해결 방법은 2가지가 있다.
1. sqlDeveloper에서 SID의 값을 orcl로 변경한다.
2. xml에서 orcl을 xe로 변경한다.
'개발 > Spring' 카테고리의 다른 글
Annotation(어노테이션) 을 쓰기위한 xml설정 (0) | 2020.04.01 |
---|---|
java.sql.SQLException: 부적합한 Oracle URL이 지정되었습니다 (오류해결) (0) | 2020.03.15 |
Java request.getParameter() 한글깨짐 오류 해결 (0) | 2020.03.11 |
댓글