• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1848
  • Last Modified:

ORA-12514 Error

Hi ,

I had wirte a code to connect remote oracle server but i cant connect its says ORA-12514 error can u tell what is that error and how to slove that !!

Error Is

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:

      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
      at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
      at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at servletPck.DBConn.main(DBConn.java:24)
			  System.out.println("Failed to load isqlPlus driver.");
	     catch( Exception ae )
	       Connection con = DriverManager.getConnection(url, "sathishnatarajan", "tspl");

Open in new window

Sathish David  Kumar N
Sathish David  Kumar N
1 Solution
Haris VCommented:
      ORA-12154: TNS:could not resolve service name

      You tried to connect to Oracle, but the service name is either missing from the TNSNAMES.ORA file or is incorrectly defined.

      The options to resolve this Oracle error are:

   1. Make sure that the TNSNAMES.ORA file exists and is in the correct directory.
   2. Make sure that the service name that you are connecting to is included in the TNSNAMES.ORA file and that it is correctly defined.
   3. Make sure that there are no syntax errors in the TNSNAMES.ORA file. For example, if there are unmatched brackets in the file (ie: open bracket without the corresponding close bracket), the file will be rendered unusable.

Sathish David Kumar NArchitectAuthor Commented:
How can we find the service name ,

i cant check that because its server , with out going to server is it possible to check in any other way
service name and database ip is written in the TNSNAMES.ORA file.
Is your db cluster??

if you use the service name, not ip, please check your HOST name.
please, write your db ip and servicename into the host file...

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now