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.