JDBC连接Oracle问题:The network Adapter could not establish the connetion.

fancuixia 2004-04-08 05:09:00
JDBC连接Oracle问题:The network Adapter could not establish the connetion.

我查了资料,据说是因为Oracle是提供了MTS服务,导致此问题发生。
我看了Oracle中关于MTS的说明,可能必须提供MTS服务才行。是否有什么方法在不停止Oracle MTS 服务的情况下,用JDBC访问Oracle?

...全文
1052 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
fancuixia 2004-04-13
  • 打赏
  • 举报
回复
已经通过OCI连接方式连通数据库。
fancuixia 2004-04-09
  • 打赏
  • 举报
回复
试一下先
fancuixia 2004-04-09
  • 打赏
  • 举报
回复
From: Jon Haugsand <Jon-H.Haugsand@norges-bank.no>
Date: 19 Nov 2001 10:47:25 +0100
Message-ID: <m3u1vrhz2q.fsf_-_@norges-bank.no>
Subject: [suse-oracle] Jdbc thin driver problem solved (was: jdbc thin driver: connection refused


Short summary: If you have problems with connecting your NT client to
your Linux server using jdbc thin client, be sure that the server
machine name as known at the server exists at the client (and is the
same name).


Long story:


* Jon Haugsand
> To all who have tried to help me, thanks. I have now gotten some help
> from Oracle and though they could not find the cause of my problem,
> they found a way to live with it. (They suspect some bad
> configuration.) Here is a summary of the problem and the suggested
> cure, just in case others should struggle with the same problem.
>
> I have two Oracle servers, one Linux and one NT. I have two Oracle
> clients, one Linux and one NT. All in all, four machines
> interconnected through tcp/ip. Each client attempts to connect to
> each server using both standard protocol (?), e.g. using sqlplus and
> the jdbc thin driver, all in all I have 8 connection scenarios.
>
> Oracle on Linux is 8.1.7 (both server and client).
> Oracle on NT is 8.1.6 (both server and client).
> Several jdbc thin drivers are tested, including the latest downloaded
> from Oracle.
>
> Linux server NT server
> ------------------------------------------------------------
> Linux sqlplus OK OK
> Linux jdbc thin OK OK
> NT sqlplus OK OK
> NT jdbc thin fails OK
>
> Driver is oracle.jdbc.driver.OracleDriver
>
> The connection string used: jdbc:oracle:thin:@192.168.22.35:1521:ora8
>
> The NT jdbc thin client failed with:
> java.sql.SQLException: Io exception: The Network Adapter could
> not establish the connection
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:335)
> at
> oracle.jdbc.driver.OracleConnection.<init>
> (OracleConnection.java:361) at
> oracle.jdbc.driver.OracleDriver.getConnectionInstance
> (OracleDriver.java:442)
> at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321)
> at java.sql.DriverManager.getConnection(DriverManager.java:517)
> at java.sql.DriverManager.getConnection(DriverManager.java:177)
> at Nytest.main(Nytest.java:54)
> java.lang.RuntimeException: SQL Exception Io exception:
> The Network Adapter could not establish the connection
> at Nytest.main(Nytest.java:70)
>
>
> Failed connection enters the listener which does not complain, but no
> activity is found on the server. (That is, I do not know how to
> measure such things. The trace and log files were almost, but not
> completely, empty and obscure.)
>
> A curious observation is that if I restart the listener at the Linux
> server, the NT jdbc thin client works for a few minutes, and then
> fails again.
>
> --------------------------------
> OK, then the CURE:
>
> The Oracle support suggested I use the following (white space free)
> connection string (structured here for readability):
>
> jdbc:oracle:thin:@(DESCRIPTION=
> (ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
> (HOST=192.168.22.35)
> (PORT=1521)))
> (CONNECT_DATA=(INSTANCE_NAME=ora8)
> (SERVICE_NAME=sil2002.norges.bank.no)))
>
> Lo and behold, this works. Thanks again for all helpfullness on this
> email list.


(Just after I sent this information, I discovered something. The
following is a copy of what I sent to the Oracle team.)

I have now discovered what might be the cause of the problem, and
I suggest that you test this out, and eventually report this to the
network development folks in your company.


What have been the situation up to now is that the Linux server has
not been a part of the local DNS i our company. That is, the server
name (banklab3) was not known as such at the NT client. Therefore, I
had to use the IP address. However, the server itself, and the Linux
client, uses the /etc/hosts file to be able to map from number to name
and vica versa.


Today, we inserted the Linux server banklab3 into the local DNS server such
that the NT client now knows that banklab3 has the matching IP address.


Today we have no problems with using the jdbc thin client as we had before.


Can it be so that the Oracle server at the Linux machine does not
"feel comfortable" with numbers and maps the IP address to its name
and returns this to the client, which does not accept this because it
does not know anything about this name?


If so, this is ceratinly not a preferred behaviour of the server, who
should respect the clients view of the world. (I humbly still admit
that there may also be some configuration problems with our Linux
server that makes this really a complex multi cause problem.)

moroser 2004-04-08
  • 打赏
  • 举报
回复
可能是你的监听器没启动
步骤:oracle安装目录-----》BIN----》TNSLSNR 双击启动
试一下
hellion1234 2004-04-08
  • 打赏
  • 举报
回复
最好在hosts文件加上域名解析,例如:

database 192.168.2.2

然后你的url就可以这样:jdbc:oracle:thin:@database:1521:check_db
Arias 2004-04-08
  • 打赏
  • 举报
回复
我也遇到这个问题了 我在本机上(win)系统上调连接就 出现了
但是把文件放到数据库server上就没有问题了
fancuixia 2004-04-08
  • 打赏
  • 举报
回复
Oracle的SID为check_db。

如果URL为
jdbc:oracle:thin:@192.168.2.2:1521:dddddd

会报错:connection refused(......)。

如果 ID 地址错误,或端口错误,或SID为 check_db,也就是真正的SID,就报错:The network Adapter could not establish the connetion.

也就是我的连接是正常的。

同样的语句,连接Windows 2000上的Oracle没有问题,有问题的是安装在Linux服务器上的Oracle。

望不吝指教。
内容概要:本文深入探讨了DMA高效数据传输实现方案在高性能计算芯片领域的应用与架构创新,重点分析了缓存一致性DMA、多通道DMA架构及其在数据中心SmartNIC、存算一体芯片和Chiplet互连等场景中的实践。文章结合RISC-V架构,通过Chisel硬件描述语言和C语言驱动代码,展示了多通道DMA控制器的设计与实现,涵盖仲裁机制、AXI总线适配、分散-聚集传输模式及中断处理等核心技术,并强调了性能优化与验证方法。最后展望了AI调度、光互连、近存计算与安全DMA等未来发展方向。; 适合人群:具备数字电路与计算机体系结构基础,从事芯片设计、嵌入式开发或高性能计算相关工作的研发人员,尤其是有1-5年经验的工程师与研究人员。; 使用场景及目标:①理解DMA在突破“内存墙”和降低系统能耗中的关键技术路径;②掌握多通道DMA控制器的硬件设计与驱动开发方法;③应用于SmartNIC、AI加速器、Chiplet等高性能芯片系统的数据传输架构设计;④为构建高带宽、低延迟、高能效的异构计算平台提供参考。; 阅读建议:此资源融合硬件设计与软件驱动,建议结合Chisel仿真与RISC-V平台实操,重点关注DMA与缓存一致性、异构计算单元的协同机制,并通过性能计数器与错误注入手段进行系统级验证。
内容概要:本文围绕基于共享储能服务的智能楼宇双层优化配置展开研究,通过Matlab代码实现相应的数学建模与仿真分析,提出一种结合上层规划与下层运行的协同优化框架,旨在提升智能楼宇能源系统的经济性、能效水平与电网互动能力。研究充分考虑光伏发电、负荷需求、储能充放电等多元因素,采用先进的优化算法(如智能优化算法)对共享储能资源的容量配置与运行调度进行精细化决策,有效降低用能成本,提高可再生能源消纳率,并增强系统运行的稳定性与灵活性。全文涵盖模型构建、算法设计、求解流程及结果验证,具备较高的理论深度与工程应用价值; 适合人群:具备电力系统、能源管理、优化算法等相关背景的科研人员、研究生,以及从事智能电网、综合能源系统、建筑节能等领域的工程技术人员; 使用场景及目标:①用于智能楼宇及园区级能源系统的规划与运行优化研究;②支撑共享储能机制下的资源配置、经济调度与商业模式设计;③作为Matlab仿真教学与高水平论文复现的典型案例,帮助深入理解双层优化模型、主从博弈结构及智能算法在能源系统中的应用; 阅读建议:建议结合提供的Matlab代码进行同步学习与调试,重点关注上下层模型的耦合关系与迭代求解过程,可进一步拓展至多主体协同、不确定性建模(如风光出力波动)及鲁棒优化等前沿方向开展深化研究。
内容概要:本文《【故障检测】基于 KPCA 的故障检测【T2 和 Q 统计指数的可视化】(Matlab代码实现)》系统阐述了基于核主成分分析(KPCA)的非线性故障检测方法,重点实现了T²和Q统计量的构建与可视化过程。通过Matlab编程,将高维非线性数据映射至特征空间,提取主成分并建立监控模型,利用T²和Q指数对工业过程中的异常状态进行联合监测与诊断,有效提升了复杂系统中早期故障的识别能力,具有较强的工程实用性与理论参考价值。; 适合人群:适用于具备信号处理、控制工程或工业过程监测背景,熟悉Matlab编程语言,并从事故障诊断、智能运维、自动化系统研发等相关工作的研究生、科研人员及工程技术开发者。; 使用场景及目标:①应用于化工、电力、制造等流程工业中的关键设备状态监控与早期故障预警;②作为学术研究中KPCA算法的仿真验证平台,用于对比分析不同非线性降维方法的检测性能;③深化对非线性过程监控中统计指标设计与阈值判定机制的理解与实践应用。; 阅读建议:建议读者结合所提供的Matlab代码逐模块运行与调试,深入掌握KPCA建模流程、主成分子空间划分及T²、Q统计量的计算逻辑,鼓励在标准数据集(如TE过程)上复现实验结果,并尝试扩展至其他非线性场景以提升模型泛化能力。

81,111

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧