Weblogic 6.1 not able to resolve Oracle DB connection string with Service_name

297 Views Asked by At

Working on a legacy web application developed in java 1.3, hosted using Weblogic 6.1, on a unix server that connects to two Databases maintained through connection pools. Due to industry level change, many Databases got reconfigured. Till now they were connected using SID, now it needs to be connected through service_name.

Connection String used till now for SID: jdbc:oracle:thin:@hostname.test.intranet:1521:sid

New Connection string after DB hosted with Service_name value jdbc:oracle:thin:@hostname.test.intranet:1521:service_name

This syntax throws

Status : Failure -Test failed: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

We can not upgrade Weblogic , is there any solution to connect with new DB string using WL6.1 ?

1

There are 1 best solutions below

2
tinnapat On

Refer to https://www.baeldung.com/java-jdbc-url-format. URL for connect to Oracle using service name is

jdbc:oracle:thin:[<user>/<password>]@//<host>[:<port>]/<service>

So you should try changing : in front of SID to /

jdbc:oracle:thin:@hostname.test.intranet:1521/service_name