Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: error in type2driver

  1. #1
    Member
    Join Date
    Oct 2013
    Location
    india
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default error in type2driver

    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    DriverManager.getConnection("jdbcracleci:@192.168.1.6:1522:apsnacs","arunasree_linux","p osidex");

    i wrote above code by setting the class path to classes12.jar

    i am getting following exception

    Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1734)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1028)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.jav a:262)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleC onnection.java:346)
    at oracle.jdbc.driver.OracleDriver.getConnectionInsta nce(OracleDriver.java:468)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java:314)
    at java.sql.DriverManager.getConnection(DriverManager .java:582)
    at java.sql.DriverManager.getConnection(DriverManager .java:185)
    at com.posidex.type2driver.TypeTwoDriver.main(TypeTwo Driver.java:15)
    please can any one solve this it's urgent requirement


  2. #2
    Member
    Join Date
    Sep 2013
    Posts
    68
    My Mood
    Confused
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default Re: error in type2driver

    You need to add the ojdbc jar to your classpath.

  3. #3
    Member
    Join Date
    Oct 2013
    Location
    india
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: error in type2driver

    Quote Originally Posted by aprabhat View Post
    You need to add the ojdbc jar to your classpath.
    dear i added to the classpath i tried with ojdbc14.jar as well classes12.jar dear.

  4. #4
    Member
    Join Date
    Feb 2014
    Posts
    180
    Thanks
    0
    Thanked 48 Times in 45 Posts

    Default Re: error in type2driver

    Related to regarding driver identification.

    Type 2 drivers are hybrid drivers that are part Java and part native. For the latter part you may need to add the associated native library/ies to some environment variables. I'm not familiar with Oracle, but I'd suggest you first find out the Oracle version that you have. After that do an Internet search for the JDBC driver download for that version. E.g., you can find the drivers for Oracle 12c Release 1 at Oracle Database 12c Release 1 JDBC Driver Downloads. Then look for the README file, which contains installation instructions that would state the environment variables you need to set up.

  5. #5
    Junior Member
    Join Date
    May 2014
    Location
    Chennai
    Posts
    9
    My Mood
    Cool
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: error in type2driver

    Hi, kindly check the below points.

    1. Whether you have installed the Oracle Client.
    2. If you have installed, kindly check whether you have added the OCI jar file is added in the classpath and path environment variable.
    3. Also pls check the version of the Oracle Client that you are using.
    4. If your java version is <= 1.3; then use the classes12.jar else try to use the client's ojdbc14.jar file in the class path.

    Let me know if you still could not resolve after checking the above points.

  6. #6
    Member
    Join Date
    Oct 2013
    Location
    india
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: error in type2driver

    Dear Bharath,
    I installed the oraclexe 10g .
    1)first i want to know what is oracle client

    --- Update ---

    Dear Bharath,
    dont mind actually i am new to java.
    how can i check wheather the odbc jars added or not in my classpath.

  7. #7
    Junior Member
    Join Date
    May 2014
    Location
    Chennai
    Posts
    9
    My Mood
    Cool
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: error in type2driver

    Okay.. You have something called as environment variables in your computer.. Classpath is one of the many environment variables. All you need to do is to edit the classpath environment variable in your computer by adding the path to the ojdbc14.jar or the OCI jar file. The new path can be appended to the existing value by using the semicolon ( as the delimiter. To find environment variables do the following.

    Right click on My Computer -> Properties -> Advanced System Settings -> Advanced Tab -> Environment Variables button (in Windows 7 OS). In case if you have not set class path till now then kindly do set it.

    Oracle client is nothing but a program which talks to the Oracle server and gets your intented work done. Its one of the client-server architecture model. Kindly refer online tutorials for more information.

Similar Threads

  1. Replies: 3
    Last Post: May 8th, 2014, 06:25 AM
  2. Replies: 2
    Last Post: March 23rd, 2014, 08:44 AM
  3. CheckBox/Spinner error Error
    By vandy22 in forum Android Development
    Replies: 1
    Last Post: February 15th, 2014, 03:05 AM
  4. Replies: 3
    Last Post: November 30th, 2013, 04:52 PM
  5. Problems with A* Map Search - GC Overload Error and Null Error
    By puneeth.meruva in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 18th, 2013, 03:01 PM