Solved

JDBC problem

Posted on 2001-07-20
12
7,233 Views
Last Modified: 2008-03-03
Dear sir,

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

Benson
0
Comment
Question by:benson031397
  • 3
  • 2
  • 2
  • +3
12 Comments
 
LVL 17

Accepted Solution

by:
k_murli_krishna earned 50 total points
ID: 6303098
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.

regards
( k_murli_krishna )
0
 
LVL 17

Expert Comment

by:k_murli_krishna
ID: 6303111
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.

regards
( K. Murli Krishna )
0
 

Author Comment

by:benson031397
ID: 6303120
Dear sir,

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

I am using the "Oracle8i 8.1.7.1 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.

Thanks!



0
 
LVL 3

Expert Comment

by:mathavra
ID: 6303450
Try the following steps from Metalink.

Doc ID:  Note:139775.1
Subject:  JDBC Connection Failure: Network adapter could not establish connection
Type:  PROBLEM
Status:  REVIEWED
 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.
*************************************************************

PROBLEM
-------

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.

REDISCOVERY
-----------

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.

For JDBC OCI:

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

   "jdbc:oracle:thin:@host:port:sid"

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).

EXPLANATION
-----------

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.

SOLUTION
--------

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.

ADDENDUM
--------

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.

 
0
 

Author Comment

by:benson031397
ID: 6304273
mathavra:

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?


Benson
0
 

Author Comment

by:benson031397
ID: 6305725
mathavra,

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

java.sql.SQLException: Io exception: Connection refused(DESCRIPT
ION=(TMP=)(VSNNUM=134238208)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))
))


Can u help me to interpret what the problem is?


Thanks!

Benson
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 3

Expert Comment

by:mathavra
ID: 6310014
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.

-Mathav
0
 
LVL 1

Expert Comment

by:selvamsm
ID: 6351231
Hi,
     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
0
 
LVL 1

Expert Comment

by:selvamsm
ID: 6351232
Hi,
     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.

thanks
selva
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6824529
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,
Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6845882
SECOND REQUEST - ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.

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.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
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.
http://www.experts-exchange.com/questions/Q.20076210.html
http://www.experts-exchange.com/questions/Q.20088967.html
http://www.experts-exchange.com/questions/Q.20093175.html
http://www.experts-exchange.com/questions/Q.20097921.html
http://www.experts-exchange.com/questions/Q.20103210.html
http://www.experts-exchange.com/questions/Q.20104138.html
http://www.experts-exchange.com/questions/Q.20109648.html
http://www.experts-exchange.com/questions/Q.20109688.html
http://www.experts-exchange.com/questions/Q.20113210.html
http://www.experts-exchange.com/questions/Q.20088493.html
http://www.experts-exchange.com/questions/Q.11225578.html
http://www.experts-exchange.com/questions/Q.20131175.html
http://www.experts-exchange.com/questions/Q.20154416.html
http://www.experts-exchange.com/questions/Q.20167468.html
http://www.experts-exchange.com/questions/Q.20173389.html
http://www.experts-exchange.com/questions/Q.20173655.html
http://www.experts-exchange.com/questions/Q.20184747.html
http://www.experts-exchange.com/questions/Q.20227572.html
http://www.experts-exchange.com/questions/Q.20255361.html
http://www.experts-exchange.com/questions/Q.20026626.html
http://www.experts-exchange.com/questions/Q.20098610.html
http://www.experts-exchange.com/questions/Q.20127814.html
http://www.experts-exchange.com/questions/Q.20132764.html
http://www.experts-exchange.com/questions/Q.20153462.html
http://www.experts-exchange.com/questions/Q.20168978.html
http://www.experts-exchange.com/questions/Q.20250983.html


To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.20026625.html
http://www.experts-exchange.com/questions/Q.20067952.html
http://www.experts-exchange.com/questions/Q.20101120.html
http://www.experts-exchange.com/questions/Q.20104135.html
http://www.experts-exchange.com/questions/Q.20114116.html
http://www.experts-exchange.com/questions/Q.20064604.html
http://www.experts-exchange.com/questions/Q.11410998.html

PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.
 
Thank you everyone.
 
Moondancer
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.
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6891160
Admin notified of User neglect. Force-accepted by
Netminder
CS Moderator
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now