Amey
Amey

Reputation: 53

JDBC Connection String for Oracle not connecting

Below are my connection settings for Oracle SQL Developer with tnsnames.ora

enter image description here

enter image description here

The pattern of jdbc string required is as below :

jdbc:oracle:thin@:1521:<DATABASE_NAME>

I have tried the following :

jdbc:oracle:thin:@ServerIP:1521:test2 , jdbc:oracle:thin:@ServerIP:1521:orcl.5bfzmyo25mfutjqfmvvj0cmrya.rx.internal.cloudapp.net:test2

But it is not connecting.

Upvotes: 0

Views: 3512

Answers (1)

Justin Cave
Justin Cave

Reputation: 231661

Assuming that

  • You want to use the Oracle thin JDBC driver
  • The database is running on ServerIP
  • The database listener is running on port 1521
  • The service name of the database is orcl.5bfzmyo25mfutjqfmvvj0cmrya.rx.internal.cloudapp.net

your connection string should be (see the linked question for additional syntax options)

jdbc:oracle:thin:@//ServerIP:1521/orcl.5bfzmyo25mfutjqfmvvj0cmrya.rx.internal.cloudapp.net

Your app server has no idea about how you've configured your local tnsnames.ora file or your local SQL Developer connection strings. So you can't reference test2 (the name of a SQL Developer connection) or any of the tnsnames.ora entries you've created on the client machine.

Upvotes: 0

Related Questions