`

The Network Adapter could not establish the connection

阅读更多

具体情况是这样,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

    The Network Adapter could not establish the connection

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

    NULL 博文链接:https://lbay.iteye.com/blog/784874

    oracle11g sqlDeveloper无法创建连接

    解决了oracle11g数据库安装后,使用自带的sqlDeveloper工具连接数据库,总是报The Network Adapter could not establish the connection这个问题

    Myeclipse链接Oracle等数据库时lo exception: The Network Adapter could not establish the connection

    今天小编就为大家分享一篇关于Myeclipse链接Oracle等数据库时lo exception: The Network Adapter could not establish the connection,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起...

    java连接oracle数据库jar包ojdbc8

    System.out.println("Connected to the database!"); // ... 其他数据库操作 conn.close(); } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); } } } ``` 在上述代码中,`hostname`...

    JDBC连接Oracle数据库常见问题及解决方法

    4. Weblogic 连接 Oracle 问题:The Network Adapter could not establish the connection 解决方法: * 可能是服务器的监听停掉了,是数据库的问题,与应用无关;应该先检查一下 Oracle 是否正常,用 sql*plus ...

    oracle12c,各种问题解决方案.docx

    2. [The Network Adapter Could Not Establish The Connection 解决方案](http://example.com/network-adapter-error) 3. [Oracle thenetworkadapter could not establish the connection]...

    SSH整合常见错误总结

    **问题描述**:尝试连接数据库时,遇到`The Network Adapter could not establish the connection`错误。 **原因分析**:数据库连接参数配置不正确或网络问题。 **解决方案**: 1. 检查数据库连接URL、用户名、...

    连接不到数据库【转】整理.pdf

    当遇到“连接不到数据库”的问题时,通常会显示如"Io异常: The Network Adapter could not establish the connection"这样的错误信息。这个异常表明应用程序无法与数据库建立网络连接,可能由多种原因造成。以下是...

    设置MyEclipse10.0连接Oracle11g数据库

    当你尝试`Test Driver`时,可能会遇到“Error while performing database login with the oracle.jdbc.driver.OracleDriver driver: Io exception: The Network Adapter could not establish the connection”的错误...

    MyEclipse报错说明

    7. **The Network Adapter could not establish the connection url user pwd dialect** 数据库连接失败,原因可能是数据库URL、用户名、密码或方言设置不正确。检查数据库连接参数是否正确无误,包括URL、用户名、...

    tomcat安装jbpm4.4

    - 如果遇到“Network Adapter could not establish the connection”的错误,可能是因为数据库连接配置不正确或网络设置有问题。请检查`server.xml`文件中的数据库连接参数,并确保Oracle服务正在运行且监听器配置...

Global site tag (gtag.js) - Google Analytics