小编dil*_*had的帖子

错误jdbc.HiveConnection:打开会话Hive时出错

我尝试为Hive2 get错误运行JBDC代码.我有hive 1.2.0版hadoop 1.2.1版.但在命令行蜂巢和直线工作没有任何问题.但jdbc得到错误.

import java.sql.SQLException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.DriverManager;

public class HiveJdbcClient {
  private static String driverName = "org.apache.hive.jdbc.HiveDriver";

  /**
   * @param args
   * @throws SQLException
   */
  public static void main(String[] args) throws SQLException {
//BasicConfigurator.configure();

  try {
      Class.forName(driverName);
    } catch (ClassNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    //replace "hive" here with the name of the user the queries should run as
    Connection con = DriverManager.getConnection("jdbc:hive2://localhost:10000/default","", "");
    Statement stmt = con.createStatement();
    String …
Run Code Online (Sandbox Code Playgroud)

java hadoop hive jdbc

7
推荐指数
1
解决办法
2万
查看次数

以Javascript行方式和列方式查找2d数组的总和

我想要像这样的数组的总和

1 1 2 = 4

2 2 1 = 5

3 3 1 = 7

= = =

6 6 4

我想在html中使用java脚本打印这样的数组.

javascript

5
推荐指数
1
解决办法
3055
查看次数

标签 统计

hadoop ×1

hive ×1

java ×1

javascript ×1

jdbc ×1