web服务器:linux+oracle+tomcat,执行下列代码:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%
  Class.forName("oracle.jdbc.driver.OracleDriver");   //.newInstance();
  String url="jdbc:oracle:thin:@10.25.140.99:1521:dbname"; //mydb为数据库的SID,10.0.1.1 为 数据库服务器 IP
  String user="post_authentication";
  String password="234";
  Connection conn= DriverManager.getConnection(url, user, password);
  Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
  String sql="select * from bb";  //test 是表名,要先建立这个表,再送几条记录
  ResultSet rs=stmt.executeQuery(sql);
  while(rs.next())
  {
%>
    第一个字段内容为:<%=rs.getString(1)%>
    
<%
  }
  out.print("数据库操作成功,恭喜。");  rs.close();
  stmt.close();
  conn.close();
%>
</body>
</html>
出现Cannot create PoolableConnectionFactory (Io 异常: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=135290880)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))))的错误.请大家指教

解决方案 »

  1.   

    Connection conn= DriverManager.getConnection(url, user, password);
    这一步报错?
    oracle起来了吗?
    用pl/sql能连上吗?好像步是你的程序的问题
      

  2.   

    Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    把这句话中的参数去掉试试。
      

  3.   

    <%@ page contentType="text/html;charset=gb2312"%>
    <%@ page import="java.sql.*"%>
    <html>
    <body>
    <%
    try
    {
    Class.forName("oracle.jdbc.driver.OracleDriver"); //.newInstance();
    String url="jdbc:oracle:thin:@10.25.140.99:1521:dbname"; //mydb为数据库的SID,10.0.1.1 为 数据库服务器 IP
    String user="post_authentication";
    String password="234";
    Connection conn= DriverManager.getConnection(url, user, password);
    out.println("Connect Successfully!!!");
    }
    catch(Exception e)
    {
    out.println(e.toString());
    }
    %>精简代码做一下测试如果连接取到,那么应该问题不大了
      

  4.   

    你的oracle驱动看起来好像是注册了,试图连接数据库时出的异常。1、确定你的oracle是否已经正常启动,并且在1521端口监听;
    2、确定你的数据库名、用户名和密码是否正确。
      

  5.   

    借光:路过的各位,帮忙看看这几个帖子,看怎么解决;)谢谢啦!关于客户端页面从数据库中读取大量图片的问题
    http://community.csdn.net/Expert/TopicView3.asp?id=4816106乱码还原问题!
    http://community.csdn.net/Expert/TopicView3.asp?id=4813786关于javabean反射代理的问题
    http://community.csdn.net/Expert/TopicView3.asp?id=4813935
      

  6.   

    String url="jdbc:oracle:thin:@10.25.140.99:1521:dbname"; //mydb为数据库的SID,10.0.1.1 为 数据库服务器 IP
    10.0.1.1你说是数据库的IP,为何连接中又不是这个地址?