title: Insert data into HIVE over HADOOP
body: <p>I am using <strong>hadoop-1.0.4 and hive-0.10.0 in redhat5</strong>. Service start successfully. I am able to create, drop, select table easily but I don't know how to insert data.</p>
  
  <p>For example I have two text box and on button click I want to store data in table (userInfo). I have no clue how to store textbox vaue in userInfo(id,password).</p>
  
  <pre><code>private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";
  
  
  try {
            Class.forName(driverName);
          } catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.exit(1);
          }
          Connection con = DriverManager.getConnection("jdbc:hive://localhost:10000/enggheads","", "");
          Statement stmt = con.createStatement();
          String tableName = "testHiveDriverTable";
          stmt.executeQuery("drop table " + tableName);
          ResultSet res = stmt.executeQuery("create table " + tableName + " (key int, value string)");
          // show tables
          String sql = "show tables '" + tableName + "'";
          System.out.println("Running: " + sql);
          res = stmt.executeQuery(sql);
          if (res.next()) {
            System.out.println(res.getString(1));
          }
  </code></pre>
  
  <p>It's Java, but I don't know how to insert two field value because Hive insertion is different than MySQL or other database syntax.</p>