org.apache.thrift.transport.TTransportException?

时间:2012-05-31 12:23:57

标签: java hadoop thrift hive

  

可能重复:
  java.sql.SQLException: org.apache.thrift.transport.TTransportException in hive?

你能告诉我这个例外发生的时间吗? “org.apache.thrift.transport.TTransportException”其实我想用java将数据存储到hive表中。当我执行上面这段代码时发生异常?

public void createTable(String tableName) {
    try{
        Statement stat = con.createStatement();

    String QueryString = "INSERT INTO logs (id, msg) VALUES(1, 'hello')";

     a = stat.executeUpdate(QueryString);
    if(a==1){
        System.out.println(a);
        System.out.println("Table has been created");
    }

    }catch(Exception e){
    e.printStackTrace();}
}

0 个答案:

没有答案