title: ExceptionInInitializerError for db2
body: <p>I have the simplest JDBC program to read data from a DB2 (or other configured) instance. When I attempt to run it from Eclipse OR from the command line, the connect fails, throwing a SQLexception </p>
  
  <pre><code> Class.forName(jdbcDriverClassName).newInstance();
  </code></pre>
  
  <p>The class.forName fails, using  <code>com.ibm.db2.jcc.DB2Driver</code>.  I configured Eclipse to point to the same driver that DBVisualizer uses (both as a boot library and for the project).  The program uses the same connect string that DBVisualizer uses.  DBVisualizer isn't having any trouble.</p>
  
  <p>Ouptut w/full stack (note the FQN for the driver is not null):</p>
  
  <pre><code>                   V-- !null driver name --V
  Attempting to load com.ibm.db2.jcc.DB2Driver
  ERROR:java.lang.ExceptionInInitializerError: null
  java.lang.ExceptionInInitializerError
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:169)
  at com.ibm.db2.jcc.DB2Driver.class$(DB2Driver.java:58)
  at com.ibm.db2.jcc.DB2Driver.&lt;clinit&gt;(DB2Driver.java:61)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:169)
  at com.onlineretailer.ecomm.dumporder.DumpOrder.main(DumpOrder.java:79)
  Caused by: java.lang.NullPointerException
  at com.ibm.db2.jcc.am.ib.i(ib.java:490)
  at com.ibm.db2.jcc.am.ib.&lt;clinit&gt;(ib.java:420)
  ... 7 more
  </code></pre>
  
  <p>I also tried adding the .newInstance() to the end of the class.forName() and it continues to execute the same behavior.</p>
  
  <p>Thanks to everyone for your time and input! </p>