Caused by: java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection

这个错误很明显是连接不到数据库,于是:

我们创建Oracle连接时(oracle11g),url往往写成:jdbc:oracle:thin:@地址:1521:ORCL,如:jdbc:oracle:thin:@localhost:1521:ORCL。

此时,有可能会报出:Oracle 网络适配器不能建立连接问题——The Network Adapter could not establish the connection 。

原因是:@后面的地址的值不一定是localhost,或是127.0.0.1 。他真正的值是和Oracle 的安装目录下的product\10.2.0\db_1\NETWORK\ADMIN目录下的listener.ora和tnsnames.ora里的host后面对应的值一样的。

如,我机子上url为:

jdbc:oracle:thin:@192.168.1.8:1521:orclsid

这样就对了

相关文章:

  • 2021-06-22
  • 2021-07-12
  • 2021-10-09
  • 2021-05-18
  • 2021-08-22
  • 2022-12-23
猜你喜欢
  • 2021-05-19
  • 2021-09-26
  • 2022-12-23
  • 2021-07-12
  • 2021-09-23
  • 2021-08-31
相关资源
相似解决方案