aspose file tools*
The moose likes JDBC and the fly likes Unknown Source error when trying to use jdbc to connect to Oracle 8.1.6.0.0 database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Unknown Source error when trying to use jdbc to connect to Oracle 8.1.6.0.0 database" Watch "Unknown Source error when trying to use jdbc to connect to Oracle 8.1.6.0.0 database" New topic
Author

Unknown Source error when trying to use jdbc to connect to Oracle 8.1.6.0.0 database

John-Philippe Verger
Greenhorn

Joined: Feb 18, 2008
Posts: 25
Hi,
I'm new in Java, and I'm trying to write a Java application connecting to Oracle 8i Enterprise Edition Release 8.1.6.0.0 database. I download classes12.zip on Oracle site and I use it in my Java classpath.Here's my code:





When I compile this class (the classe ClasseDb2 above) on command-line with
, it works fine(there's no error message on command-line).But when , after the compilation, I want to launch the program with , the following error messages are displayed on command-line:


I don't know why I can compile but there's a problem when I want to run this class.
For precision, I join my tnsnames.ora:





Thanks you help



²
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19004
    
  40

I don't know why I can compile but there's a problem when I want to run this class.


During compilation, only the classes and jar files needed directly by the source files as used -- to resolve symbols, signatures, etc. The compiler doesn't bother checking if the class files and jar files, needed by the class files and jar files, are available and valid.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 375
Looks like you are trying to use a thick oracle driver. i.e. There is a native library involved. Maybe you haven't installed the native components of Oracle. Hence the unsatisfied link error.

By installing Oracle client software (I can't help you with the exact information, but look for any Oracle software installation which includes thick driver installation) the issue will probably get resolved.

Alternatively try using a thin driver. i.e. pure java driver by using the following jdbc url.

jdbc:oracle:thin:@localhost:1521:JOHNDB

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39885
    
  28
Welcome to JavaRanch I think this thread would sit better on the JDBC forum, so shall move it.
I had to edit a post to get rid of a which I did by marking the "disable smilies" box.
 
jQuery in Action, 2nd edition
 
subject: Unknown Source error when trying to use jdbc to connect to Oracle 8.1.6.0.0 database