• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

no ocijdbc9 in java.library.path in JDK 1.4.2

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does JDK 1.4.2 look for oracle 9i and above?
Is there a way to make it point to Oracle 8i or equivalent?

Actually I am getting following error :
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:304)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:377)

at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:515)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:345)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DBTest.main(DBTest.java:9)
My simple java program ois as follows :

import java.sql.* ;

public class DBTest
{
public static void main(String args[]) throws Exception
{
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
Connection conn =
DriverManager.getConnection("jdbc racle ci8:@database","username","password");
}
}

I have set java.library.path to Oracle_Home/ora81/bin.
how do I resolve this problem?

Thanks
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jitesh,
I see you are using the OCI (or "thick") [JDBC] driver.
Perhaps you are unaware that this is a type 3 JDBC driver that requires
native libraries that are part of the Oracle client software. Therefore,
in order to use the OCI driver, the "Oracle client" software must also be
installed. (Is it?)

Personally, I use the "thin" driver, which is a type 4 driver, and so only
uses java. That way, I only need access to the JDBC driver. In order to use
the "thin" driver, simply replace "oci8" with "thin" in your connection URL,
as in:

Good Luck,
Avi.
 
Jitesh Sinha
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oracle 8.1.7 is installed on my system and java.library.path is set to ORACLE_HOME/bin...
 
Jitesh Sinha
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any pointers on this one???
is it a problem with jdk1.4.2 so that it searches for only oracle 9i?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try to change it to use the thin (Type-4) Driver as mentioned above? If so, you'll need to add the library to your classpath as in this thread.

Dave
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jitesh Sinha:
is it a problem with jdk1.4.2 so that it searches for only oracle 9i?

If anything is requesting the library, it's the driver -- not the JDK itself, 1.4.2 or otherwise. Did you find a DLL at that location that looked appropriate?

I second David's recommendation of using the type 4 driver if at all possible. It's freely available from Oracle and I believe it works with 8. If not, you should be able to find the library at Oracle's site, too.
 
Jitesh Sinha
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I appreciate your replies....
Type 4 drivers work...but that is against my organization's standards...I have only one option and that is Type 3 drivers....
I have ocijdbc8.dll in my oracle_home/bin directory but driver searches for ocijdbc9.dll....
So how do I make the driver point to ocijdbc8.dll and NOT ocijdbc9.dll....???
Thanks...
 
Jitesh Sinha
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got the solution now...I had two versions of classes12.jar...one of which was having a driver that was searching for ocijdbc9 ....I repalced this jar file with the one which came with oracle 8.1.7 client installation...
Now it works...
Thanks ya'all....
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic