java.sql.SQLException: Listener refused the connection with the following error

      jdbc连接ORACLE数据库(11g)时出现如题错误的一种可能: 

//oracle连接标识
        String url = "jdbc:oracle:thin:@192.168.0.200:1521:orcl";

必须与

文件:oracle\product\10.2.0\db_1\network\admin\tnsnames.ora中:

RHORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.200)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

对应:@后面接相对应的HOST,PORT,SERVICE_NAME的值

posted on 2015-03-04 15:21  因胖被判变瘦  阅读(2548)  评论(0编辑  收藏  举报