• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7381
  • Last Modified:

JDBC problem

Dear sir,

Can JDBC for Oracle8i support Oracle 8(8.0.5.x.x) also?

  • 3
  • 2
  • 2
  • +3
1 Solution
Dear Benson,
            If JDBC supports Oracle 8i then it can support lower versions and 8.0.5.x.x are definitely the lowest versions. Actually JDBC seems independent of Oracle since we work equally well with JDBC 1.2 and 2 both on oracle enterprise edition version 8.1.6. It is the drivers and connectivity which matter and they also seem okay as long as you look for a downgrade.

( k_murli_krishna )
Dear Benson,
            Here is a follow up. The JDBC API which is an user interface for coding is automatically shipped with the installation and so are the drivers. If we use thin and oci type oracle based drivers for connectivity, then JDBC is not involved at all. Hope i am clear.

( K. Murli Krishna )
benson031397Author Commented:
Dear sir,

Actually, I got a problem in oracle JDBC problem.
Problem :

I am using the "Oracle8i JDBC Drivers for use with JDK 1.2.x for Solaris" to write applications in B server.

And the oracle 8 is installed in the another server, called A server.

The following is the coding which connect to A server oracle8.
Con = DriverManager.getConnection("jdbc:oracle:thin:[IP Address]", "onebox", "onebox");

However, I cannot connect it.

The error message is :
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

Pls help.


Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Try the following steps from Metalink.

Doc ID:  Note:139775.1
Subject:  JDBC Connection Failure: Network adapter could not establish connection
 Content Type:  TEXT/PLAIN
Creation Date:  13-APR-2001
Last Revision Date:  11-JUL-2001

This article is being delivered in Draft form and may contain
errors.  Please use the MetaLink "Feedback" button to advise
Oracle of any issues related to this article.


You are attempting to connect to an Oracle instance using JDBC
and you are receiving the following error.

   java.sql.SQLException: Io exception:
     The Network Adapter could not establish connection

   SQLException: SQLState (null) vendor code (17002)

Any or all of the following other conditions may also apply:

1) You are able to establish a SQL*Plus connection from the same
   client to the same Oracle instance.

2) You are able to establish a JDBC OCI, but not Thin connection
   from the same client to the same Oracle instance.

3) The same JDBC application is able to connect from a different
   client to the same Oracle instance.

4) The same behavior applies whether the initial JDBC connection
   string specifies a hostname or an IP address.


To verify whether you are hitting this problem, verify whether the
Oracle instance is configured for Multithreaded Server (MTS).

If the Oracle instance is not configured for MTS, you are probably
encountering a different problem. Otherwise, continue.

Try forcing the JDBC connection to use a dedicated server instead
of a shared server. This can be accomplished in several ways.

For JDBC OCI or Thin, this can be done by reconfiguring the server
for dedicated connections only. This approach, however, may not be
feasible in many cases. In such cases, the following options apply.


1) Add the (SERVER=DEDICATED) property to the TNS connect string
   stored in the tnsnames.ora file on the client.

2) Set the user_dedicated_server=ON in sqlnet.ora on the client.

For JDBC Thin:

You must specify a full name-value pair connect string (the same
as it might appear in the tnsnames.ora file) instead of the short
JDBC Thin syntax. For example, instead of


you would need to use a string of the form

   "jdbc:oracle:thin:@(DESCRIPTION="                   +
                         "(ADDRESS_LIST="              +
                             "(ADDRESS=(PROTOCOL=TCP)" +
                                      "(HOST=host)"    +
                                      "(PORT=port)"    +
                             ")"                       +
                         ")"                           +
                         "(CONNECT_DATA="              +
                             "(SERVICE_NAME=sid)"      +
                             "(SERVER=DEDICATED)"      +
                         ")"                           +

If the connection works fine after having made these changes, it
is very likely that this is the problem you are encountering. In
this case, one last test will help to verify this fact.

Log into the remote host on which the Oracle instance is running
and execute the appropriate command to determine what the server
'thinks' its hostname is (i.e. the name that was configured when
the server was installed and configured). For example, on a Unix
host the 'hostname' command can be used for this purpose.

Using the name displayed (e.g. by the hostname command), exactly
as it appeared (i.e. if the output from the hostname command had
the domain name included, then include it), return to the client
which was unable to connect and try pinging the server.

NOTE: It is critical that you attempt to ping the server using
      EXACTLY the same hostname you got from the server.

If you are unable to ping the server via this hostname, then you
almost certainly hitting this problem. If not, this may be a new
issue, but at least you will have found a workaround (i.e. use a
dedicated connection).


To understand why this problem occurs, one must first understand
the differences in how the listener handles connections to shared
servers versus dedicated servers.

When connecting to a dedicated server, the client connects to the
listener (via hostname or IP address). The listener then spawns a
dedicated server process and hands off the socket used to accept
the client connection to that server. The client and server then
start communicating via the endpoints established by the initial
connection. NOTE: There is only one connection in this case.

When connecting to a shared server, the initial client connection
to the listener is the same. However, with MTS, there is no need
to spawn a new server process; a pool of shared processes already
exists. Also, clients do not communicate directly with the server
processes in MTS; rather, they communicate with a dispatcher.

For this reason, when setting up an MTS connection, the listener
sends a redirect message back to the client asking the client to
close the connection to the listener and connect to a dispatcher.
The information in this message includes the hostname and a port
number for the appropriate dispatcher. The redirect message will
ALWAYS specify a hostname, even if the client initially provided
an IP address.

If, for any reason, the hostname provided to the listener (e.g. by
the 'hostname' or another command) doesn't agree with the hostname
by which the server is known on the client, the connection fails.

On the other hand, if "(SERVER=DEDICATED)" already appears in the
TNS connect string in tnsnames.ora or if "use_dedicated_server=ON"
already appears in the sqlnet.ora file, you may find that SQL*Plus
and/or JDBC OCI work fine, while JDBC Thin fails.


Obviously, one solution is to use dedicated servers. However, this
may not always be feasible.

The key is to make sure the hostname on both the client and server
agree. This can be accomplished by reconfiguring either the client
or the server, but there are things to be aware of in both cases.

If the server is configured to return a different hostname, then it
is possible that other clients which used to work will now fail.

In some cases, it may not be feasible to reconfigure the client. For
example, if the server version of the hostname does not include the
domain, you would need to remove the domain portion of the hostname
on the client; but, if the client needs to connect to more than one
server with the same base name in different domains, this may not be
possible, as the hostname may be ambiguous.


As of the time of this writing, another problem which results in the
same error is under investigation. In this case, JDBC connections to
an MTS server fail if the client has a static IP address, but do not
fail if the client is configured via DHCP. Using a dedicated server
corrects the problem in this case as well, though the reasons for
this are not yet clear.

benson031397Author Commented:

Thank you very much indeed.  It is a very clear solution.

However, to summarize,

To make the connect string simple as

jdbc:oracle:thin:[IP Address]", "onebox", "onebox"

is to make the oracle instance as dedicated server.

that's it?  right?

benson031397Author Commented:

I have tried the connect string which you suggest, I got another error message :

java.sql.SQLException: Io exception: Connection refused(DESCRIPT

Can u help me to interpret what the problem is?


The error stands for "TNS:listener could not resolve SID given in connect descriptor". Can you double check whether your SID is set right (ORACLE_SID). Also, double check the SID is registered in the listener.

     Check the service name in the init<sid>.ora file and
give the same in the listener and in the tnsnames.ora file(jdbc conenct string).

      To check whether the listener is reacheable from u'r client u can run the TNSPING utility from the client as
TNSPING <service_name> from the DOS
     Check the service name in the init<sid>.ora file and
give the same in the listener and in the tnsnames.ora file(jdbc conenct string).

      To check whether the listener is reacheable from u'r client u can run the TNSPING utility from the client as
TNSPING <service_name> from the DOS prompt and it will show whether the listner is reachable.

Hope this will help to reduce u'r search area.

benson--->  You have asked 128 questions here and only graded/finalized 94 of them.  These are all your open questions here, please update and finalize them all.  Administration has been advised. In addition, 10 of them have been unresolved due to -1 userid conditions, which resulted from jsp-500 errors of that time, which are being manually corrected.  To quickly navigate through all your open/locked questions, click your Member Profile and expand your question history.

If you need help to special handle any of these open questions, comment with details here or post a zero point question in the Community Support topic area with the QID (link).  The HELP DESK contains the Guidelines/Member Agreement and the Q/A process detail.

Experts, please comment with closing recommendations if these items remain open by the end of this week, so we can finalize them.

 Win Prog. Exchange Client Application 50 Open 01/07/2001
 Linux Net. Mount Point Setup 50 Open 02/12/2001
 Apache file execution in Apache 50 Open 03/08/2001
 Java Serialized Java Object 50 Open 03/17/2001
 Java Java Compiling Error 50 Open 03/27/2001
 Web Tools iPlanet Problem! 50 Open 03/29/2001
 Oracle About Oracle 9i IAS problem. 50 Open 04/08/2001
 Oracle Download Oracle8i (8.1.6) for Intel Linux. 50 Open 04/10/2001
 Java Segmentation Fault in jdk1.2.2 on linux Platform 50 Open 04/25/2001
 Linux Net. eth0 checksum error 50 Open 04/25/2001
 Oracle sqlplus problem 50 Open 05/04/2001
 Vignette About Vignette 10 Open 03/07/2001
 Apache Apache and JSP 50 Open 09/08/2000
 Java KVM and CVM 50 Open 05/31/2001
 MS Site Server Java service provider for MS site server 50 Open 06/07/2001
 Oracle pro*c compiler in 8.1.6, where? 50 Open 06/10/2001
 Palm Pilot CDK, Java Edition Problem. 50 Open 07/19/2001
 Oracle JDBC problem 50 Open 07/20/2001
 Java Puzzling Question in Java 100 Open 08/13/2001
 Java Comment of JBuilder and VisualAge 50 Open 08/15/2001
 PHP Installation of PHP on Unix System and work with iPlanet 50 Open 12/17/2000
 Java delete function in File Class problem. 100 Open 08/24/2001
 Java File.delete() functions problem. 100 Open 08/24/2001
 Solaris rcp(remote copy) problem. 50 Open 09/19/2001
 Unix Prog. Strange problem in the shared memory access. 50 Open 11/06/2001
 Web Tools JBoss iPlanet/Apache 50 Open 01/03/2002
 Java ABout Runtime class problem 50 Open 01/15/2002

Thanks all,
Community Support Moderator @ Experts Exchange

Question(s) below appears to have been abandoned. Your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.

To view your open questions, please click the following link(s) and keep them all current with updates.

To view your locked questions, please click the following link(s) and evaluate the proposed answer.

------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.
Thank you everyone.
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
Admin notified of User neglect. Force-accepted by
CS Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now