Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error facing while trying to connect Oracle XE

 
Rudra Nath
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I installed Oracle XE in my PC and tried to connect to Oracle using JDBC.
I am getting error:"listener does not currently know of service requested in connect descriptor", while trying to connect to Oracle XE using JDBC.
Please help.
Please find below code snippet, and TNSNAMES.ORA for the database



error:
INFO: Jk running ID=0 time=0/64 config=null
29 Apr, 2012 1:00:23 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8264 ms
java.sql.SQLException: Listener refused the connection with the following error:

ORA-12514, TNS:listener does not currently know of service requested in connect
descriptor
The Connection descriptor used by the client was:
Rudre-PC:1521

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:111)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:260)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
413)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensio
n.java:34)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and you can connect using these values from the oracle client (SQLPLUS or something better if they now supply that)?

I did a quick search out there and the actions a website i trust suggested were

  • Wait a moment and try to connect a second time.
  • Check which services are currently known by the listener by executing: lsnrctl services
  • If an easy connect naming connect identifier was used, check that the service name specified is a service known by the listener.
  • Check for an event in the listener.log file.
  •  
    Wendy Gibbons
    Bartender
    Posts: 1111
    Eclipse IDE Oracle VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    And welcome to JavaRanch Rudra Nath
     
    chris webster
    Bartender
    Posts: 2407
    33
    Linux Oracle Postgres Database Python Scala
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Oracle XE only gives you one database, and its name is "XE".

    I think your connection string should look like this:

    If you are working on a local machine, you could also try changing the machine name in your JDBC string and your TNSNAMES to be "localhost" (or the default TCP loopback address 127.0.0.1).



     
    Rudra Nath
    Greenhorn
    Posts: 9
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Many Thanks Chris.
    Your solution helped me!!!
    Thanks again!!!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic