Home » Infrastructure » Windows » The Network Adapter could not establish the connection
The Network Adapter could not establish the connection [message #146731] Sun, 13 November 2005 08:34
siew goon tan
Messages: 2
Registered: July 2004
Junior Member
I'm a beginner user of Oracle 9i database

I need to run a java code that connects to Oracle database using JDBC. This is my final year project in college.
I can connect to database successfully and perform select, update and delete successfully.
But sometime the Oracle will failed me with below message:

java.sql.SQLException: Io exception: The Network Adapter could not establish the
connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)

at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at myclass.dbconnection.<init>(dbconnection.java:28)

I realize everytime the oracle failed, may be is cause by the listener connection, because when I perform nestat -a, the connection port sime like use up to port 4999, as below

Proto Local Address Foreign Address State
TCP ocbc-2zgor5xhfn:http 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:epmap 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:https 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:microsoft-ds 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:1025 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:1031 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:1032 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:2030 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:2100 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:3006 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:3007 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:3339 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:5000 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:8009 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:8010 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:8080 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:8228 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:1032 localhost:1748 ESTABLISHED
TCP ocbc-2zgor5xhfn:1521 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:1521 localhost:3006 ESTABLISHED
TCP ocbc-2zgor5xhfn:1521 localhost:3651 TIME_WAIT
TCP ocbc-2zgor5xhfn:1748 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:1748 localhost:1032 ESTABLISHED
TCP ocbc-2zgor5xhfn:1754 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:1808 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:1809 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:3001 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:3002 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:3003 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:3004 localhost:4999 TIME_WAIT
TCP ocbc-2zgor5xhfn:3005 localhost:1521 TIME_WAIT
TCP ocbc-2zgor5xhfn:3006 localhost:1521 ESTABLISHED
TCP ocbc-2zgor5xhfn:3008 0.0.0.0:0 LISTENING
TCP ocbc-2zgor5xhfn:3008 localhost:3065 TIME_WAIT
..............
TCP ocbc-2zgor5xhfn:4993 localhost:4994 TIME_WAIT
TCP ocbc-2zgor5xhfn:4995 localhost:1521 TIME_WAIT
TCP ocbc-2zgor5xhfn:4996 localhost:4997 TIME_WAIT
TCP ocbc-2zgor5xhfn:4998 localhost:1521 TIME_WAIT
TCP ocbc-2zgor5xhfn:8005 0.0.0.0:0 LISTENING
UDP ocbc-2zgor5xhfn:microsoft-ds *:*
UDP ocbc-2zgor5xhfn:isakmp *:*
UDP ocbc-2zgor5xhfn:ntp *:*
UDP ocbc-2zgor5xhfn:1900 *:*
UDP ocbc-2zgor5xhfn:2234 *:*
UDP ocbc-2zgor5xhfn:3951 *:*

is it I use up all connection port???
Normally after I wait for a while these connections will decrease, then my program run as normal again, why???
below is the java file I use to connect oracle and files setting:

dbconnection.java

public class dbconnection {
public Connection connection;
private String sourceurl;
private String username;
private String password;

public dbconnection()
{
sourceurl ="jdbc:oracle:thin:@localhost:1521:apiitdb1";

username = "tanabc";
password = "tanabc";
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
connection = DriverManager.getConnection(sourceurl,username,password);
}

catch{

.................
}
}

init.ora

##############################################################################
# Copyright (c) 1991, 2001, 2002 by Oracle Corporation
##############################################################################

###########################################
# Cache and I/O
###########################################
db_block_size=8192
db_cache_size=25165824
db_file_multiblock_read_count=16

###########################################
# Cursors and Library Cache
###########################################
open_cursors=300

###########################################
# Database Identification
###########################################
db_domain=""
db_name=apiitdb1

###########################################
# Diagnostics and Statistics
###########################################
background_dump_dest=C:\oracle\admin\apiitdb1\bdump
core_dump_dest=C:\oracle\admin\apiitdb1\cdump
timed_statistics=TRUE
user_dump_dest=C:\oracle\admin\apiitdb1\udump

###########################################
# File Configuration
###########################################
control_files=("C:\oracle\oradata\apiitdb1\CONTROL01.CTL", "C:\oracle\oradata\apiitdb1\CONTROL02.CTL", "C:\oracle\oradata\apiitdb1\CONTROL03.CTL")

###########################################
# Instance Identification
###########################################
instance_name=apiitdb1

###########################################
# Job Queues
###########################################
job_queue_processes=10

###########################################
# MTS
###########################################
dispatchers="(PROTOCOL=TCP) (SERVICE=apiitdb1XDB)"

###########################################
# Miscellaneous
###########################################
aq_tm_processes=1
compatible=9.2.0.0.0

###########################################
# Optimizer
###########################################
hash_join_enabled=TRUE
query_rewrite_enabled=FALSE
star_transformation_enabled=FALSE

###########################################
# Pools
###########################################
java_pool_size=33554432
large_pool_size=8388608
shared_pool_size=50331648

###########################################
# Processes and Sessions
###########################################
processes=150

###########################################
# Redo Log and Recovery
###########################################
fast_start_mttr_target=300

###########################################
# Security and Auditing
###########################################
remote_login_passwordfile=EXCLUSIVE

###########################################
# Sort, Hash Joins, Bitmap Indexes
###########################################
pga_aggregate_target=25165824
sort_area_size=524288

###########################################
# System Managed Undo and Rollback Segments
###########################################
undo_management=AUTO
undo_retention=10800
undo_tablespace=UNDOTBS1


listener.ora

# LISTENER.ORA Network Configuration File: C:\oracle\ora92\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\ora92)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = apiitdb1)
(ORACLE_HOME = C:\oracle\ora92)
(SID_NAME = apiitdb1)
)
)

LOG_FILE_LISTENER = lsnr8
TRACE_FILE_LISTENER = lsnr18
CONNECT_TIMEOUT_LISTENER=0

tnsnames.ora

# TNSNAMES.ORA Network Configuration File: C:\oracle\ora92\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.

APIITDB1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = apiitdb1)
)
)

INST1_HTTP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(PRESENTATION = http://HRService)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)


LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 13-NOV-2005 01:39:
47

Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Produc
tion
Start Date 12-NOV-2005 20:23:53
Uptime 0 days 5 hr. 16 min. 2 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File C:\oracle\ora92\network\admin\listener.ora
Listener Log File C:\oracle\ora92\network\log\lsnr8.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC0ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocbc-2zgor5xhfn)(PORT=8009))(Present
ation=HTTP)(Session=RAW))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocbc-2zgor5xhfn)(PORT=2100))(Present
ation=FTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "apiitdb1" has 2 instance(s).
Instance "apiitdb1", status UNKNOWN, has 1 handler(s) for this service...
Instance "apiitdb1", status READY, has 1 handler(s) for this service...
Service "apiitdb1XDB" has 1 instance(s).
Instance "apiitdb1", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>

I wish anybody can help me, I had try to solve the problem almost two week....
Previous Topic: 8i personal edition on win98
Next Topic: Newbie - Which options do I install
Goto Forum:
  


Current Time: Fri Mar 29 09:59:48 CDT 2024