0

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 ?

Vishesh
  • 133
  • 3
  • 11

1 Answers1

1

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
tinnapat
  • 356
  • 2
  • 12
  • thank for format. But on using this Weblogic printing this error: `java.sql.SQLException: Io exception: Invalid connection string format, a valid format is: "host:port:sid" at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)` It is** Weblogic 6.1** setup in 2000, not sure if it can be configured with new connection string format, which is itself not so new now. – Vishesh Jul 15 '22 at 05:34
  • 1
    What is the version of Oracle database and Java are you using? I think you may to need to upgrade oracle JDBC driver to new version to support the new URL format but you need to find one with support both Java and oracle you are using. – tinnapat Jul 18 '22 at 07:18