Error on connecting database


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 10 of 10

Thread: Error on connecting database

  1. #1
    Join Date
    Oct 2007
    Posts
    0

    Error on connecting database

    Hi guys, I am using windows XP and Oracle 9.0 When I try to connect to the database using the following statement

    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());

    // Connect to the local database
    Connection conn = DriverManager.getConnection ("jdbcracleci8:@mydatabase", "scott", "tiger");
    I get the following error message:

    Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: C:\orant\BIN\oci805jdbc.dll: Can't find dependent libraries
    at java.lang.ClassLoader$NativeLibrary.load... Method)
    Can anyone guide me please?
    Thanks in advance.
    Last edited by pauler; 10-25-2007 at 03:07 AM.

  2. #2
    Join Date
    Oct 2007
    Posts
    4

    Error connecting to oracle

    Oracle 9 uses the dll in the following folder C:\oracle\ora92\bin\ocijdbc9.dll the C:\orant\BIN\oci805jdbc.dll this is for previous version of Oracle.

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Do you mean for Oracle, the path is hard coded?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  4. #4
    Join Date
    Oct 2007
    Posts
    4

    Error connecting to oracle

    Quote Originally Posted by Hack
    Do you mean for Oracle, the path is hard coded?
    // Connect to the local database
    Connection conn = DriverManager.getConnection ("jdbc oracle oci8:@mydatabase", "scott", "tiger");

    Oracle 9 uses the dll in the following folder C:\oracle\ora92\bin\ocijdbc9.dll the C:\orant\BIN\oci805jdbc.dll this is for previous version of Oracle.


    Yes, the hardcoded path must include the ocijdbc9. Your files for Oracle 9 should in the c:\oracle\ora92 the version prior to Oracle 9 used the c:\orant\..... Check to see an oracle or orant folder. Thanks.

  5. #5
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Thanks for the info. It just seems odd to do it this way.

    My whole career as a programmer I've been beaten about the head and shoulders while being yelled at never, ever hard code anything.

    For a product as universal and powerful as Oracle it just seems like an odd way to run a railroad.

    BTW: Welcome to DevX
    Last edited by Hack; 10-25-2007 at 02:22 PM.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  6. #6
    Join Date
    Oct 2007
    Posts
    4
    Quote Originally Posted by dba
    // Connect to the local database
    Connection conn = DriverManager.getConnection ("jdbc oracle oci8:@mydatabase", "scott", "tiger");

    Oracle 9 uses the dll in the following folder C:\oracle\ora92\bin\ocijdbc9.dll the C:\orant\BIN\oci805jdbc.dll this is for previous version of Oracle.


    Yes, the hardcoded path must include the ocijdbc9. Your files for Oracle 9 should in the c:\oracle\ora92 the version prior to Oracle 9 used the c:\orant\..... Check to see an oracle or orant folder. Thanks.
    I agree don't hard code. Let's try again. Remove the 8 from oci8 because it is looking for the library that in the version prior to 9 it was located in a different folder. The library that you need is the oci.

  7. #7
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Is the oci a folder?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  8. #8
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    paular "0 posts" interesting ...
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  9. #9
    Join Date
    Oct 2007
    Posts
    4

    error connecting oracle

    Quote Originally Posted by Hack
    Is the oci a folder?
    No, oci is a library. The error you received was telling you that oracle could not find the oci8 library. The library name changed from oci8 to oci and the location of the library changed in version 9 of oracle. It is no longer in the orant folder by in the oracle folder. Hope this helps.

  10. #10
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Thanks for the info.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Connecting to Access Database and running Queries
    By Dazza204 in forum VB Classic
    Replies: 1
    Last Post: 02-13-2005, 08:32 PM
  2. Connecting to MS Access Database
    By Delali Dzirasa in forum .NET
    Replies: 1
    Last Post: 06-14-2002, 02:19 PM
  3. Connecting to Database from COM Object.
    By Ali Imran in forum VB Classic
    Replies: 0
    Last Post: 07-14-2001, 04:32 AM
  4. Connecting database
    By Sai in forum VB Classic
    Replies: 3
    Last Post: 06-07-2001, 10:13 AM
  5. Multiple Database Architecture
    By mholt28 in forum VB Classic
    Replies: 1
    Last Post: 06-05-2000, 12:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center