在linux系统执行自己开发的Java jar包时,发现无法连接windows下的Oracle数据库,一步一步进行检测。
首先相互能ping通,windows与linux防火墙均关闭,linux中SELinux也disabled了。
测试1521端口,无法访问(telnet安装请参考https://www.jianshu.com/p/d5fabecba56b)
[root@localhost ~]# telnet 192.168.43.206 1521
Trying 192.168.43.206...
telnet: connect to address 192.168.43.206: Connection refused
[root@localhost ~]#
修改oracle监听,找到oracle目录中的listener.ora文件(大概目录为product\11.2.0\dbhome_1\NETWORK\ADMIN)


[root@localhost ~]# telnet 192.168.43.206 1521
Trying 192.168.43.206...
Connected to 192.168.43.206.
Escape character is '^]'.
再次运行jar文件,信息成功入库。
网友评论