Java JDBC - How to connect to Oracle using Service Name instead of SID

前端 未结 8 1100
醉话见心
醉话见心 2020-11-22 15:14

I have a Java application that uses JDBC (via JPA) that was connecting to a development database using hostname, port and Oracle SID, like this:

jdbc:oracle:

8条回答
  •  萌比男神i
    2020-11-22 15:29

    Try this: jdbc:oracle:thin:@oracle.hostserver2.mydomain.ca:1522/ABCD

    Edit: per comment below this is actualy correct: jdbc:oracle:thin:@//oracle.hostserver2.mydomain.ca:1522/ABCD (note the //)

    Here is a link to a helpful article

提交回复
热议问题