Search code examples
jdbcweblogicdatasourceconnection-pooling

How to specify URL correctly for connection pool in Weblogic


How would I create a connection pool with the below information. I think I am getting wrong in URL.

(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = myDB01.com)(PORT = 1821))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = myDB.com)
    )
  )

I tried specifying the below in URL, but, didn't work

jdbc:oracle:thin:@myDB01.com:1821:myDB.com

This is the exception I see in the logs on server start up

oracle.net.ns.NetException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

Note: I am able to connect to the DB from Oracle client successfully.


Solution

  • You need to use this format:

    jdbc:oracle:thin:[USER/PASSWORD]@//[HOST][:PORT]/SERVICE
    

    http://www.orafaq.com/wiki/JDBC