Solution to Oracle10G ORA-12505 Problems

Source: Internet
Author: User

Today, when I am developing a project about **, I am using PLSQL to connect to Oracle. However, in Myeclipse DB's attempt, the url I have been using is the following code:

  1. Jdbc: oracle: thin:127. 0.0.1:1521: Jdbh

The following error message always appears:

  1. Java. SQL. SQLException: Listener refused the connection with the following error:
  2. <Span style ="Color: # ff0000 ;"> ORA-12505, TNS: listener does not currently know of SID given in connect descriptor
  3. TheConnection descriptor used by the client was:
  4. Localhost:1521: Jdbh
  5. </Span>
  6. Atoracle. jdbc. driver. DatabaseError. throwSqlException (DatabaseError. java:124)
  7. Atoracle. jdbc. driver. DatabaseError. throwSqlException (DatabaseError. java:279)
  8. Atoracle. jdbc. driver. T4CConnection. logon (T4CConnection. java:318)
  9. Atoracle. jdbc. driver. PhysicalConnection. <init> (PhysicalConnection. java:343)
  10. Atoracle. jdbc. driver. T4CConnection. <init> (T4CConnection. java:147)
  11. At oracle. jdbc. driver. T4CDriverExtension. getConnection (T4CDriverExtension. java:31)
  12. Atoracle. jdbc. driver. OracleDriver. connect (OracleDriver. java:545)
  13. Atjava. SQL. DriverManager. getConnection (Unknown Source)
  14. Atjava. SQL. DriverManager. getConnection (Unknown Source)
  15. At cn.com. db. DBAccess. getConnection (DBAccess. java:33)
  16. At cn.com. db. DBAccess. main (DBAccess. java:95)

I have read some materials on the Internet and have not mentioned the specific solution. My personal summary is as follows:

Solution:

Open the tnsnames. ora file in the path D: \ oracle \ product \ 10.2.0 \ db_1 \ NETWORK \ ADMIN to view the following code:

  1. # Tnsnames. ora Network Configuration File: D: \ oracle \ product \10.2.0\ Db_1 \ network \ admin \ tnsnames. ora
  2. # Generated by Oracle configuration tools.
  3. ORCL =
  4. (DESCRIPTION =
  5. (ADDRESS = (PROTOCOL = TCP) (HOST = RedArmychen-PC) (PORT =1521))
  6. (CONNECT_DATA =
  7. (SERVER = DEDICATED)
  8. <Span style ="Color: # ff0000 ;"> (SERVICE_NAME = orcl)
  9. </Span>)
  10. )
  11. EXTPROC_CONNECTION_DATA =
  12. (DESCRIPTION =
  13. (ADDRESS_LIST =
  14. (ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1 ))
  15. )
  16. (CONNECT_DATA =
  17. (SID = PLSExtProc)
  18. (PRESENTATION = RO)
  19. )
  20. )

Do you see my standard red font?(SERVICE_NAME = orcl)Then you only need to modify the connection URL:

  1. Jdbc: oracle: thin:127. 0.0.1:1521: Orcl

The problem can be solved. This is only a solution for personal errors! If there are any exceptions, please be patient.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.