1.拒绝连接
java.sql.SQLException: Io 异常: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=135294976)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))) 原因:一般为登录用户及密码错误.
注意:此错误可能与 java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection 有些不同
2.java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by the client : 192.168.13.100:1525:ora10
// listener.ora 配置如下
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oakingDevSRV)(PORT = 1525)) //配置的是1525端口(因为此开发机安装有oracle8i的数据库,用了1521) ) )
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC = (SID_NAME = PLSExtProc)
(ORACLE_HOME = G:/oracle10G/product/10.2.0/db_1)
(PROGRAM = extproc) )
/// (SID_DESC = 以///标出的几行内容可能在采用缺省安装时oracle没有将SID 写入,我的就是这样,手工修改
/// (GLOBAL_DBNAME = ora10)
/// (ORACLE_HOME = G:/oracle10G/product/10.2.0/db_1)
/// (SID_NAME = ora10)
/// )
)
3. 网络连接异常
Error mssage: jdbc:oracle:thin:@192.168.13.100:1525:ora10) java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
第一种情况为oracle's Listener 没有启动 无法创建下列URL的连接:
第二种情况为连接的端口与oracle's Listener 侦听的端口配置不相同 无法创建下列URL的连接: jdbc:oracle:thin:@192.168.13.100:1521:ora10) //端口错误了,应该为1525