Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Role of XE

 
Seshaiah Chimata
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please advice what is the role of XE from the following line of code.

I found the following entry in tnsnames.ora file

I am able to execute the program. My question is, Are these related ?

Also, I changed the above 2 entries as given below



I am getting following error
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:xe24


Please advice

Thanks,
Seshu
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, the first example uses "XE" in 3 places. The second one uses "XE19" in two places, "XE24" in one place, and then causes an error message. It seems kind of obvious what should be tried to fix the error, no?
 
Seshaiah Chimata
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even if I mess up with tnsnames.ora file and use this snipped in my code, It works fine

I want to know the relationship between my program and tnsnames.ora file.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seshaiah Chimata wrote:I want to know the relationship between my program and tnsnames.ora file.

There isn't any. The connect string you're using does not use TNSNAMES.

Our Oracle FAQ contains a link to a page explaining connection strings. A connection string that would utilize TNSNAMES looks different from what you have.
 
Seshaiah Chimata
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Martin, I am clear with connection string usage but not sure how to use/leverage tnsnames.ora file. Can you please provide an example how connection string can utilize tnsnames.ora file
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's been a while, but I believe tnsnames.ora is only used when you are using the "thick" oracle client.

WP
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm probably at risk of sounding repetitive, but our Oracle FAQ contains a link to a page explaining connection strings, in as much detail as necessary.

The description includes how to form a connection string which uses tnsnames.ora and also mentions that since version 10.2.0.1.0 even the thin driver does support using tnsnames.ora.

It is exactly two clicks away from here. Please ShowSomeEffort.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic