我用的是oracle 10g,主机名为john,监听接口为1521.数据库名为oracletest,
sid为orcl
java代码:
      String url = "jdbc:oracle:thin:john:1521:orcl";
      Class.forName("oracle.jdbc.driver.OracleDriver");
      conn = DriverManager.getConnection(url, "sysman", "123");
帮我看看有没有写错?错误: Listener refused the connection with the following error:
ORA-12518, TNS:listener could not hand off client connection
The Connection descriptor used by the client was:
localhost:1521:orcl

解决方案 »

  1.   

    String url = "jdbc:oracle:thin:john:1521:john";
    你试试可以吗
      

  2.   

    少那一个@吧???String url = "jdbc:oracle:thin:@john:1521:orcl";
      

  3.   

    用String url = "jdbc:oracle:thin:@john:1521:orcl";会出现错误:指定了无效的 Oracle URL所以我自作主张 把@改成: (我知道8i9i是写@的 因为我用的是10g的)
    反而没提示url无效
      

  4.   

    上面那句话取消.
    用String url = "jdbc:oracle:thin:@john:1521:orcl";
    错误是:
    Listener refused the connection with the following error:
    ORA-12518, TNS:listener could not hand off client connection
    The Connection descriptor used by the client was:
    john:1521:orcl
    貌似url没错了,还是会出现同样的错误:无法分发客户端连接