1

可能重复:
Eclipse 无法在 Windows 7 上连接 oracle 10g XE

当我尝试测试连接时出现此错误..

java.sql.SQLException:Io 异常:网络适配器无法建立连接”

现在要做什么?我也从站点下载了 ojdbc14.jar,但我仍然收到此错误。

4

1 回答 1

0

执行以下步骤首先使用 Sql plus 检查:

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 29 08:51:27 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn system
Enter password:
Connected.
SQL> select instance_name from V$instance;
INSTANCE_NAME
----------------
xe
SQL>

Here is the listener status and services


C:\>lsnrctl services

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:46:43
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER <machine: KIRANKUMAR-PC, pid: 3632>
(ADDRESS=(PROTOCOL=tcp)(HOST=KiranKumar-PC)(PORT=49160))
Service "XE_XPT" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully


C:\>lsnrctl status

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:46:56
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Start Date 29-JUL-2008 08:39:27
Uptime 0 days 0 hr. 7 min. 29 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.ora
Listener Log File C:\oraclexe\app\oracle\product\10.2.0\server\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=KiranKumar-PC)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=KiranKumar-PC)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "XE_XPT" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully

C:\>TNSPING xe
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:49:28
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = KiranKumar-PC)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
OK (250 msec)


C:\>tnsping localhost-pc<hostname>
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:49:42
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
OK (170 msec)

请检查这个...让我知道解决方案..希望这会有所帮助!

于 2012-07-12T12:49:54.313 回答