NullPointerException if native JDBC/ODBC library not found

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: 5.0
    • Component/s: core-libs



      Name: js151677 Date: 08/31/2004


      A DESCRIPTION OF THE REQUEST:
      A simple modification would improve error messages when the native JDBC/ODBC library is not found.

      In JdbcOdbcDriver.initialize(), there is this bit of code:

        try {
          OdbcApi = new JdbcOdbc(tracer, nativePrefix);
          ....
        } catch (Exception exception) {
              ...log...
        }

      This drops the SQLException thrown by the JdbcOdbc constructor on the floor. The "OdbcApi" variable remains null, causing a NullPointerException a bit later.

      Simple fix: add "catch (SQLException e) { throw e; }" to allow the more useful exception to get through to the user.

      JUSTIFICATION :
      An easy enough fix to improve a strange error message. A few people have run into this; google for it, or search the Java forums.
      (Incident Review ID: 301469)
      ======================================================================

            Assignee:
            Amit Handa (Inactive)
            Reporter:
            Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: