• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Error facing while trying to connect Oracle XE

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 L Gibbons
    Bartender
    Posts: 1111
    Eclipse IDE Oracle VI Editor
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    And welcome to JavaRanch Rudra Nath
     
    Bartender
    Posts: 2407
    36
    Scala Python Oracle Postgres Database Linux
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Many Thanks Chris.
    Your solution helped me!!!
    Thanks again!!!
    reply
      Bookmark Topic Watch Topic
    • New Topic