ORA-12505 Errors and solutions when JDBC connects to Oracle databases

Source: Internet
Author: User

Oracle Problem Description: The following error occurred while using JDBC to connect to the Oracle database: Connection refused (description= (tmp=) (vsnnum=153093120) (err=12505) (Error _stack= (Error= (code=12505) (emfi=4)))

and directly through the Sqlplus or Toad can connect the database, after the debug and find the relevant data to find the cause of the problem is as follows:

When JDBC connects to the database, it needs to use the sid_name of the database rather than the services_name of the database and use Plsql to connect the database, only the services_name of the database is required, so modify the Services_ in the connection string Name is Sid_name

View the current sid:sql> Select instance_name from v$instance in the database;

Turn from: http://www.blogjava.net/itspy/archive/2007/12/20/169072.html

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.