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

No suitable driver when using JdbcOdbcDriver on WinNT

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.1.6
    • core-libs
    • x86
    • windows_95



      Name: rm29839 Date: 06/10/98


      Occasionally using JDK1.1.5 and JDK1.1.6 (with -nojit)
      and always JDK1.1.6 without -nojit I get that
      exception in the following code:

          public boolean openDatabase(String database) {
              String url = "jdbc:odbc:" + database;
              try {
                  con = DriverManager.getConnection(url, "", "");
                  stmt = con.createStatement();
              }
              catch(Exception e) {
                  System.err.println("Error opening ->" + url + "<-\n" + e);
                  errorMessage = e.toString() + " opening " + url;
                  return false;
              }
              return true;
          }

      This code produces the following when database is
      set to "Skelton"

      Error opening ->jdbc:odbc:Skelton<-
      java.sql.SQLException: No suitable driver

      I get the error only when running my full application
      which includes that code. When using a standalone, small
      program I never have the problem.

      I discovered by including:

          -Djdbc.drivers=sun.jdbc.odbc.JdbcOdbcDriver

      on the command line (JDK1.1.6, haven't tried 1.1.5
      yet), the problem disappears.
      (Review ID: 29417)
      ======================================================================

            jellissunw Jon Ellis (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: