title: error when using jdbc.app.DB2Driver
body: <p>I install db2 expressC 10.5 in an Arch Linux (in virtual machine). Then i try to use COM.ibm.db2.jdbc.app.DB2Driver to connect to the DB2. All the results are class not found or driver not found. Here is my code:</p>
  
  <pre><code>import java.sql.*;
  import java.io.*;
  import java.lang.*;
  
  class MyJDBC {
      static {
          try { 
              Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
          } catch (Exception e) {
              System.out.println("Error");
              e.printStackTrace();
          }
      }
  
      public static void main(String argv[]) {
          try {
              Connection con = null;
              String url = "jdbc:db2:sample";
              if (argv.length == 0) {
                  con = DriverManager.getConnection(url); 
              } else if (argv.length == 2) {
                  String userid = argv[0];
                  String passwd = argv[1];
                  con = DriverManager.getConnection(url, userid, passwd);
              } else {
                  throw new Exception("\nUllU");
              }
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery
               ("SELECT EMPNO, LASTNAME " +
                " FROM employee"  +
                " WHERE SALARY &gt; 40000 " );
              while (rs.next()) {
                  System.out.println("empno = " + rs.getString(1) + " lastname = " + rs.getString(2));
              }
              rs.close();
              stmt.close();
              con.close();
  
          } catch(Exception e) {
               e.printStackTrace();
         }
      } 
  }
  </code></pre>
  
  <p>The environment is:</p>
  
  <pre><code>java version "1.7.0_40"
  OpenJDK Runtime Environment (IcedTea 2.4.1) (ArchLinux build 7.u40_2.4.1-3-x86_64)
  OpenJDK 64-Bit Server VM (build 24.0-b50, mixed mode)
  </code></pre>
  
  <p>CLASSPATH:</p>
  
  <pre><code>   /home/db2inst1/sqllib/java/db2java.zip:/home/db2inst1/sqllib/function:/home/db2inst1/sqllib/java/db2jcc_license_cu.jar:/home/db2inst1/sqllib/tools/clpplus.jar:/home/db2inst1/sqllib/tools/jline-0.9.93.jar:/home/db2inst1/sqllib/java/db2jcc.jar:.
  </code></pre>
  
  <p>I think all the drivers(db2java.zip, etc) can be reach, but when i run: <code>java MyJDBC</code>, it shows:</p>
  
  <pre><code>java.sql.SQLException: No suitable driver found for jdbc:db2:sample
      at java.sql.DriverManager.getConnection(DriverManager.java:596)
      at java.sql.DriverManager.getConnection(DriverManager.java:233)
      at MyJDBC.main(MyJDBC.java:19)
  </code></pre>
  
  <p>If specify the classpath:  <code>java -cp "sqllib/java/*:." MyJDBC</code>. Firstly, the program throws an exception(java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver). Then it shows the right answer. That's unbelievable. Hope someone can help me. Thanks.</p>
  
  <p>PS: I know the new way to connect to DB2 by jcc.DB2Driver, and it works well in my machine. But why the old way cannot work?</p>