title: Getting error while using maven dependency for db2jcc.jar for db2 database connectivity?
body: <p>I am working on <code>DB2</code> database and i have created sample java program using maven to connect to <code>DB2</code> database. </p>
  
  <p>Code are here:</p>
  
  <pre><code>String jdbcClassName = "com.ibm.db2.jcc.DB2Driver";
  String url = "jdbc:db2://192.168.1.63:50000/sample";
  String user = "admin";
  String password = "admin";
  Connection connection = null;
  try {
      //Load class into memory
      try {
          Class.forName(jdbcClassName);
      } catch (ClassNotFoundException e1) {
          e1.printStackTrace();
      }
      //Establish connection
      connection = DriverManager.getConnection(url, user, password);
  } catch(ClassNotFoundException e) {
      e.printStackTrace();
  } catch(SQLException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>When I use <code>db2jcc.jar</code> through class path inside my code, then it was working but if I used <code>db2jcc.jar</code> through maven then it was not working. </p>
  
  <p>Maven configuration is as follows:</p>
  
  <pre><code>       &lt;dependency&gt;
              &lt;groupId&gt;com.ibm.db2.jcc&lt;/groupId&gt;
              &lt;artifactId&gt;db2jcc&lt;/artifactId&gt;
              &lt;version&gt;3.8.47&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.ibm.db2.jcc&lt;/groupId&gt;
              &lt;artifactId&gt;db2jcc_license_cu&lt;/artifactId&gt;
              &lt;version&gt;3.8.47&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>Error which i am getting are:-</p>
  
  <pre><code>java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
  at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:259)
  at EzJava.main(EzJava.java:19)
  </code></pre>
  
  <p>Please help me on How to use <code>db2jcc.jar</code> through maven in my project.</p>