连接oracle出问题!

zzqok 2003-08-05 02:17:24
我有WEB应用服务器和ORACLE服务器各一台,现在WEB应用服务器用jdbc连接ORACE时
弹出“java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection”异常。
但同样的用该程序连接另一台ORACLE服务器时,一切正常!
且在ORACLE服务器操作sqlplus也一切正常!
...全文
22 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Drate 2003-08-05
  • 打赏
  • 举报
回复
Re: Java.SQL.Exception The Network Adapter could not establish the connection
Author: parthas_k@yahoo.com
In Reply To: Java.SQL.Exception The Network Adapter could not establish the connection Jul 11, 2003 7:24 AM

Reply 8 of 8


Hi Guys,

I have seen this problem in almost all the forums.Now a solution is achieved.

Try this.

This problem is mainly due to the connection URL specified for the Oracle thin driver.
Few steps to debug this scenario...

1) Check for the class path frst.
2) Check whether the listner is running.
Linux or Solaris check --> ORA_HOME/bin/lsnrctrl.sh
Windows -->ORA_HOME/bin/lsnrctrl.exe
3) If these are Okay, the problem is with your Connection URL. Check the following.

In case of Linux or Solaris Use the below code:

DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=Host_name)(PORT=1521)))(CONNECT_DATA=(SID=service_name)(SERVER=DEDICATED)))", "usernam", "password");

In the above URL SERVER = DEDICATED is mandatory for Linux or Solaris.

In case of WINDOWS Use the below code:

DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host_name)(PORT=1521)))(CONNECT_DATA=(SID=service_name)(SERVER=DEDICATED)))", "username", "password");

In the above URL (SERVER = DEDICATED) is optional for Windows.

If you still dont get a solution please let me know.


kerisyml 2003-08-05
  • 打赏
  • 举报
回复
懂意思的吧,
在连接池中需要修改一个缓存小于4000的
kerisyml 2003-08-05
  • 打赏
  • 举报
回复
Cause: More than one long buffer in the bind list.
Action: Change the buffer size to be less than 4000 for the bind variable bound
to a normal column.
csusmart 2003-08-05
  • 打赏
  • 举报
回复
你的连接池配的不对吧!

17,377

社区成员

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

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