title: java.lang.ClassNotFoundException: org.apache.hadoop.hive.jdbc.HiveDriver in eclipse
body: <p>I am also add all jars file of usr/local/share/hadoop/mapreduce/*jars, usr/local/hadoop/common, hive-exec-xxx.jar, hive-metastore-xxx.jar and hive-jdbc-xxx.jar.</p>
  
  <p>hive terminal working well.</p>
  
  <p>My code is:</p>
  
  <pre><code>private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";
  
  try {
          Class.forName(driverName);
          Connection con;
  
          con = DriverManager.getConnection("jdbc:hive://localhost:10000/default", "", "");
  
          Statement stmt = con.createStatement();
  
          stmt.executeQuery("CREATE DATABASE demodb");
          System.out.println("Database userdb created successfully.");
  
          con.close();
  
      } catch (ClassNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  </code></pre>
  
  <p>exception: </p>
  
  <pre><code>java.lang.ClassNotFoundException: org.apache.hadoop.hive.jdbc.HiveDriver
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:264)
  at hive.CRUDHive.main(CRUDHive.java:15)
  </code></pre>