Solved

ORA-12514 Error

Posted on 2009-07-01
3
1,827 Views
Last Modified: 2012-05-07
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:
//tts-windowsapps:1521/XE

      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)
try{
			  Class.forName("oracle.jdbc.driver.OracleDriver");
			  System.out.println("Failed to load isqlPlus driver.");
		  }
	     
	     catch( Exception ae )
	     {
	    	 ae.printStackTrace();
	     }
	      
	       Connection con = DriverManager.getConnection(url, "sathishnatarajan", "tspl");
	      con.close();
	  }

Open in new window

0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Expert Comment

by:Haris V
ID: 24752702
Error:
      ORA-12154: TNS:could not resolve service name

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

Action:
      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.


0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 24752766
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
0
 
LVL 1

Accepted Solution

by:
gkhngkdmr earned 500 total points
ID: 24753634
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...

C:\WINDOWS\system32\drivers\etc
0

Featured Post

Webinar: Deploying MySQL in production 6/22 11am

Join Percona’s Senior Operations Engineer, Daniel Kowalewski as he presents Deploying MySQL in production on Thursday, June 22, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question