具体情况是这样,Oracle10g数据库。是局域网,所以我的IP是192.168.5.43。
conn=DriverManager.getConnection("jdbc:oracle:thin:@192.168.5.43:1521:test","user","pwd");
网络net
test=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = test)
)
)
修改为127.0.0.1时,问题解决,所以最终的问题是连接的主机字符串问题。
一般情况下,连接别的主机时,我们最好将其设为IP地址而非计算机名。
连接自己的电脑时,设为127.0.0.1而非计算机名。
The Network Adapter could not establish the connection
转载上一篇:专业的网页测试工具 YSLOW
下一篇:恢复删除的表结构【转】
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Liveness probe failed: Could not connect to Redis at localhost:6379
背景今天在部署一个平台容器版的时候redis集群始终无法正常启动,报以下错误:Liveness probe failed: Could not connect to Redis at localhost:6379解决过程排除dns解析问题因为报localhost无法访问首先修改成127.0.0.1排除是dns解析的问题,改完后仍然报错,只不过localhost改成127.0.0.1了。
k8s cni0 flannel.1 Count not connet to docker -
java.sql.SQLException: IO 错误: The Network Adapter could not establish the connection
java.sql.SQLException: IO 错误: The Network Adapter could not establish the connectionat oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:419)at oracle.jdbc.driver.PhysicalConnection.<init&g
java Network java.sql.SQLExceptio The Network Adapter