[JDBC] Oracle 접속 방법(SID와 Service Name)

Sprngboot에서 DataSource설정 시 SID와 Service Name일 경우 설정 값이 다르다.

 

SID
jdbc:oracle:thin:@//hostname:port:sid

Service Name
jdbc:oracle:thin:@//hostname:port/serviceName

 

spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
#spring.datasource.url=jdbc:oracle:thin:@10.111.11.11/PLMDEV2 -- SID
spring.datasource.url=jdbc:oracle:thin:@10.111.11.11:1521:PLMDB -- Service Name
spring.datasource.username=test
spring.datasource.password=1234

 

'📕 Programing > 이슈정리' 카테고리의 다른 글

Invalid cursor position  (0) 2020.05.20
ORA-01476: divisor is equal to zero  (0) 2020.05.20
긴 파일 삭제하기  (0) 2020.05.20

댓글

Designed by JB FACTORY