Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4096230

Unable to load JdbcOdbc driver

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 1.1.4
    • core-libs



      Name: rm29839 Date: 12/01/97


      Got a sample code - SimpleSelect.java from your
      site.
      When trying to run the sample code in
      SimpleSelect.java, I get the following error :

      Loading JdbcOdbc library
      ld.so.1: /VirgoUsers/cybernate/java/jdk1.1.4/bin/../bin/sparc/green_threads/java: fatal: libodbcinst.so.1: can't open file: errno=2 (libJdbcOdbc.so)
      Unable to load JdbcOdbc library
      java.sql.SQLException: Unable to load JdbcOdbc library
              at sun.jdbc.odbc.JdbcOdbc.<init>(JdbcOdbc.java:91)
              at sun.jdbc.odbc.JdbcOdbcDriver.initialize(JdbcOdbcDriver.java:321)
              at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:159)
              at java.sql.DriverManager.getConnection(DriverManager.java:91)
              at java.sql.DriverManager.getConnection(DriverManager.java:134)
              at SimpleSelect.main(Sample.java:51)
      Unable to load JdbcOdbc library
      Unable to allocate environment
      getConnection: no suitable driver
      java.sql.SQLException: No suitable driver
              at java.sql.DriverManager.getConnection(DriverManager.java:111)
              at java.sql.DriverManager.getConnection(DriverManager.java:134)
              at SimpleSelect.main(Sample.java:51)
      SQLException: SQLState(08001)

        *** SQLException caught ***

      SQLState: 08001
      Message: No suitable driver
      Vendor: 0

      I have the odbc drivers installed, but they do not
      have the libodbcinst.so.1 file. It has only
      libodbcinst.so. The path for this file is included
      in my LD_LIBRARY_PATH.


      Here is the piece of code giving the problem :

                           // Load the jdbc-odbc bridge driver
       
                           Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
       
                           DriverManager.setLogStream(System.out);
       
                           // Attempt to connect to a driver. Each one
                           // of the registered drivers will be loaded until
                           // one is found that can process this URL
       
                           Connection con = DriverManager.getConnection (
                                   url, "beta", "beta");
       
                           // If we were unable to connect, an exception
                           // would have been thrown. So, if we get here,
                           // we are successfully connected to the URL
       
      -------------------------------------------------------------------
      (Review ID: 21051)
      ======================================================================

            mhapnersunw Mark Hapner (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: