Io 异常: The Network Adapter could not establish the connection 解决方法
来源:互联网 发布:mac系统升级教程 编辑:程序博客网 时间:2024/06/01 15:22
1、IP错误
在设置URL时错误,例如:jdbc:oracle:thin:@192.168.1.80:1521:orcl
数据库服务器是否正确:ping 服务器IP是否通畅。ping不通则将URL更改正确。
端口号是否正确。
进行一下操作:在DOS上键入sqlplus,检查oracle是否开启
一切正常则执行下面第2步。
注意:当写程序用自己电脑上的数据库时,myeclipse里面的IP要写127.0.0.1或者localhost,否则容易出现问题。用其他电脑的数据库时,myeclipse里面的IP可以写
实际的IP。
2、防火墙
如果机器上安装有放火墙,可能是服务器端口号屏蔽而造成的。关闭防火墙后,尝试重新连接。
仍然不行则执行第3步。
3、数据库监听器未启动
修改PC上注册表中的ImagePath值。
下面以ORACLE数据库为例
重新手动启动数据库监听:
开始 → 运行→ 输入CMD→ 进入DOS命令提示界面
d:>lsnrctl
LSNRCTL> status
或者
LSNRCTL> start
如果是类似图片中的信息
恭喜,你的问题已经查找出来,是数据库监听器未启动而造成的。
以下是手动启动数据库的方法:
在运行处执行regedit进入注册表到
开始 →运行→ regedit
按下面路径
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/OracleOraHome90TNSListener
找到OracleOraHome90TNSListener(我用的是Oracle9i 其他的版本的应该是OracleOraHomexxxTNSListener)
找到之后你会发现ImagePath关键值不存在了,创建它:(存在的话,点击修改,修改方法在下文有介绍)
右键单击,弹出菜单选择新键(N)→字符串值(S)
将其命名为ImagePath
选中ImagePath点右键,选中修改:
在值中输入你的Oracle安装目录/ora90(其他版本对应的是oraxxx目录)/bin/tnslsnr
确定后退出注册表:
再在DOS命令下键入start
如果出现下面画面,恭喜你,监听器启动成功:
关闭DOS,启动你的程序进行测试,应该恢复正常了。
以上就是3中常见的引发The Network Adapter could not establish the connection 异常的原因。
原文地址:http://blog.csdn.net/mr_von/article/details/2880626
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- Io 异常: The Network Adapter could not establish the connection
- ListView的listitem为EditText无法输入内容问题
- Linux常用命令(足以应付面试&转载)
- android 在Bitmap上进行绘图操作
- 【bzoj1149】【ctsc2007】【风铃】【dp】
- Andrew机器学习课程笔记(3)—— K均值、SVM、PCA
- Io 异常: The Network Adapter could not establish the connection 解决方法
- Linux下计算文件哈希值和文件比较
- Java数据库简介
- javascript中闭包
- MyEclipse8.5连接mysql数据库遇到的_SET问题
- erl_线性结构-Josephu(约瑟夫问题 )问题
- Java中集合框架(1)
- 《剑指offer》二进制中1的个数
- 【Android开发】音乐播放器的小例子