oracle 在 red hat 9 上不能连接的问题!!!!

gototop99 2004-07-14 04:57:35
我的JSP程序在WIN2K上的TOMCAT上连接ORACLE 817 成功,但是拿到RED HAT LINUX9上的TOMCAT 中就不能运行,TOMCAT的版本都是4.1.30。就是一个最简单的连接都不行。源文件如下:
<%@ page contentType="text/html;charset=gb2312" language="java" %>
<%@ page import="java.sql.*"%>
<%@ page import="oracle.jdbc.pool.*"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>录</title>
</head>
<body>
11111111111111111111111

<%
Connection conn; //数据库连接对象
Statement stmt; //SQL语句对象
ResultSet rs; //结果集对象


try {out.println("*********** a1 *********");

OracleConnectionPoolDataSource ocpds = new OracleConnectionPoolDataSource();
out.println("*********** a2 *********");
String strCon = "jdbc:oracle:thin:@192.168.0.212:1521:oracl";
ocpds.setURL(strCon);
ocpds.setUser("jssys");
ocpds.setPassword("jssystem");

out.println("*********** a2222 *********");

conn= ocpds.getConnection();

// Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
//

//设置数据库连接字符串
// String strCon = "jdbc:oracle:thin:@192.168.0.212:1521:oracl";

//连接数据库
// conn = DriverManager.getConnection(strCon,"jssys","jssystem");
out.println("*********** a3 *********");
//创建一个可以滚动的只读的SQL语句对象
stmt = conn.createStatement();


out.println("*********** 1 *********");

String sql="select * from gdcic_user where user_id='111'";
rs=stmt.executeQuery(sql);
while (rs.next()){
out.println("userid=111");
out.println("office= "+rs.getString("user_office"));

}
out.println("********** 2 **********");
/*
rs.close;
stmt.close;
conn.close;*/
}
catch (SQLException e){
out.println("********** 3 **********");
out.println(e.getMessage());


e.printStackTrace();
}
catch (Exception ex){
out.println("********** 4 **********");


ex.printStackTrace();
}

%>

22222222222222222222222222222

</body>
</html>

16:39:24.659 ERROR [http80-Processor4] - Io 异常: The Network Adapter could not establish the connection
16:39:24.664 ERROR [http80-Processor4] - Cannot open connection
java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection ...........
Caused by: java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection
...........
... 50 more
...全文
63 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
gototop99 2004-07-16
  • 打赏
  • 举报
回复
今天测试了oracle的几个classes12包,大小不同,都还是不行。
网络是通的,因为都能够出现登录界面。

真的是不知道怎么做啊。。。。。。
honbo 2004-07-15
  • 打赏
  • 举报
回复
是不是redhat的防火墙限制了?或者根本网络就不通?
gototop99 2004-07-15
  • 打赏
  • 举报
回复
并且,所有的包都拷贝到了linux
gototop99 2004-07-14
  • 打赏
  • 举报
回复
ORACLE 数据库安装在另外的一台 LINUX 上面,并且此机不关机(除非停电,哈哈)。

并且在WIN2K上一样的程序就可以访问啊。

是不是两台都是LINUX ,所以有问题????
hare1975 2004-07-14
  • 打赏
  • 举报
回复
oracle监听服务打开没有
ChDw 2004-07-14
  • 打赏
  • 举报
回复
就是 你的Oracle没有启动之类的吧

81,091

社区成员

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

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