Io exception: the network adapter cocould not establish the connection Solution

Source: Internet
Author: User

1. IP address error:
URL setting error, for example: JDBC: oracle: thin: @ 192.168.1.80: 1521: orcl

Whether the database server is correct: ping the Server IP address. The Ping rule does not change the URL correctly.

Whether the port number is correct.

Perform the following operations: Type sqlplus on DOS and check whether oracle is enabled.

If everything is normal, perform the following step.


2. Firewall

If a firewall is installed on the machine, it may be caused by blocking the server port number. Close the firewall and try again.

If not, perform step 1.


3. The Database Listener does not start to modify the ImagePath value in the Registry on the PC.

The following uses the Oracle database as an example.

Restart the Database Listener manually:

1: Start → run → Enter cmd → enter the DOS command prompt page

D:> LSNRCTL

LSNRCTL> Status

Or

LSNRCTL> Start

For information similar to the image





Congratulations, Your problem has been found out because the Database Listener is not started.

The following describes how to manually start a database:

Execute Regedit at the runtime to enter the Registry

Start→Run→Regedit

Follow the path below

HKEY_LOCAL_MACHINE/system/CurrentControlSet/services/oracleorahome90tnslistener

Locate oracleorahome90tnslistener (I am using Oracle9i and other versions should be oracleorahomxxtnslistener)





After finding it, you will find that the key value of ImagePath does not exist. Create it: (if it exists, click Modify. The modification method is described below)

Right-click and choose new key (n)> string value (s) from the shortcut menu)



Name it ImagePath

Right-click ImagePath and select modify:




Enter your Oracle installation directory/ora90 (other versions correspond to the oraxxx directory)/bin/tnslsnr




Confirm and exit the registry:

In the doscommand, type start

If the following figure appears, congratulations, the listener is started successfully:




Close dos and start your program for testing. It should be restored to normal.

The above is the common cause of the network adapter cocould not establish the connection exception in 3.
I also encountered this exception, So I posted it to my blog.

 

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.