Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > JDBC and Oracle on OS X

JDBC and Oracle on OS X
Thread Tools
Forum Regular
Join Date: Jul 2000
Location: Jersey City, NJ 07304
Status: Offline
Reply With Quote
Jan 29, 2002, 03:49 PM
 
Hi, I'm trying to write a java app that accesses an Oracle DB on another computer.
I've used MySQL JDBC drivers before without problem.
But when I try the same things with oracle, I get:

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

I've tried two different class jars for the driver, one from Oracle themselves but no luck. The driver class definitely gets found, but then it fails to just make the connection.

Why doesn't this work on OS X?
     
Junior Member
Join Date: Apr 2001
Location: Petersfield, UK
Status: Offline
Reply With Quote
Jan 29, 2002, 05:48 PM
 
I have just been doing much the same thing. I have to connect to an oracle database for my final year project.

I use a file called classes111.zip from orcale to provide the drivers.

I have had a few problems connecting (not least because they gave me the wrong name for the database) but only got that 'Network' one when I tried to use some of the other Oracle driver files. It might be that you need different ones depending on the version? I am NO expert.

I have found a program called DbVisualiser really useful. It allows you to look at the structure etc of the database but better still it is written in Java and so allows me to see if the problem is my code or the Oracle drivers!

Its available from http://www.minq.se/products/dbvis/ and is free (under certain circumstances I think.)

Hope this helps, James
     
Fresh-Faced Recruit
Join Date: Dec 2001
Location: Everywhere
Status: Offline
Reply With Quote
Jan 29, 2002, 06:31 PM
 
Some thoughts:

Make sure your connection string/URL are correct. I recall that the Oracle and MySQL connect strings are different to an extent more than changing "mysql" to "oracle" or what-not.

Make sure your username/password/dbname are correct too.

Try the same Java code on a non-Mac machine first.

Call getErrorCode() on the SQLException to get the vendor error code, and x-ref this against the Oracle documentation. getSQLState() might help as well.

Make sure that permissions on the Oracle side are as such so you can connect.

As you have said, MySQL works okay for me. It could be a bug in the Oracle driver you are using; obviously make sure you have the latest version; went on a long bug-hunt for Oracle JDBC drivers at one point in my life (over a year ago), and didn't have much luck; I think the file pointed at to me was the one you're mentioning, though.

Steve http://www.seapod.org
     
Forum Regular
Join Date: Jul 2000
Location: Jersey City, NJ 07304
Status: Offline
Reply With Quote
Jan 31, 2002, 04:23 PM
 
Thanks seapod,
the host was wrong in the string. I had gotten the string from someone who was running Oracle locally and he was using a host name only accessible locally.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:35 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2