Io exception: Three solutions for The Network Adapter could not establish the connection

1. IP error.
Error while setting URL, for example: jdbc:oracle:thin:@192.168.0.36:1521:sharp
database server is incorrect: ping the server IP is correct. Incorrect, change the URL to the correct
port number Wrong: generally not wrong.
Do the following: Type sqlplus on DOS, check whether oracle is turned on
, but it is normal, and execute the second step below.

2. Firewall
If a firewall is installed on the machine, it may be caused by the blocking of the server port number. After turning off the firewall, try connecting again.
Still not working, go to step 3.

3. Database monitoring is not started Modifying the ImagePath value in the registry on the PC.
I will use the current mainstream database ORACLE as an example
to manually restart the database monitoring:
1: Start → Run → Enter CMD → Enter the DOS command prompt interface
d:>lsnrctl
LSNRCTL> status
or
LSNRCTL> start

The following is how to manually start the database:
Execute regedit at the runtime to enter the registry to
Start → Run → regedit Find OracleOraHome90TNSListener at
the following path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
OracleOraHome90TNSListener (I am using Oracle9i, other versions should be OracleOraHomexxxTNSListener)




After finding it, you will find that the ImagePath key value does not exist, create it: (if it exists, click to modify, the modification method is described below)
Right-click, and select the new key (N) → string value (S) from the pop-up menu to


set it Named ImagePath
, select ImagePath, right-click, and select Modify:



Enter your Oracle installation directory\ora90 in the value (oraxxx directory for other versions)\bin\tnslsnr



After confirming, exit the registry:
then type start under the DOS command
if it appears The following screen, congratulations, the listener started successfully:



close DOS, start your program for testing, it should return to normal.
The above are the common causes of The Network Adapter could not establish the connection exception in 3

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326856392&siteId=291194637