oracle 11g JDBC连接数据库:IO异常The Network Adapter could not establish the connection 解决方法

时间:2021-06-27 08:30:04

一、jdbc的drive选择:

oracle官网说明:

http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html

oracle 11g JDBC连接数据库:IO异常The Network Adapter could not establish the connection 解决方法 ojdbc5.jar (2,095,932 bytes) - Classes for use with JDK 1.5. It contains the JDBC driver classes, except classes for NLS support in Oracle Object and Collection types.
oracle 11g JDBC连接数据库:IO异常The Network Adapter could not establish the connection 解决方法 ojdbc5_g.jar (3,426,203 bytes) - Same as ojdbc5.jar, except that classes were compiled with "javac -g" and contain tracing code.
oracle 11g JDBC连接数据库:IO异常The Network Adapter could not establish the connection 解决方法 ojdbc6.jar (2,714,189 bytes) - Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.
oracle 11g JDBC连接数据库:IO异常The Network Adapter could not establish the connection 解决方法 ojdbc6_g.jar (4,463,274 bytes) - Same as ojdbc6.jar except compiled with "javac -g" and contains tracing code.
我用的 JDK 1.6 选用ojdbc6

二、选择正确的驱动后解决 

Io 异常: The Network Adapter could not establish the connection

1、IP错误:
在设置URL时错误,例如:jdbc:oracle:thin:@192.168.0.111:1521:disease
数据库服务器是否正确:ping 服务器IP是否通畅。ping不通则将URL更改正确。
端口号是否正确。
进行一下操作:在DOS上键入sqlplus,检查oracle是否开启
一切正常则执行下面。
2、防火墙
如果机器上安装有放火墙,可能是服务器端口号屏蔽而造成的。关闭防火墙后,尝试重新连接。