import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.SQLException;

import java.sql.Statement;

 

public class HiveJdbc {

private static String driverName = "org.apache.hive.jdbc.HiveDriver";

 

public static void main(String[] args) throws SQLException {

try {

Class.forName(driverName);

} catch (ClassNotFoundException e) {

e.printStackTrace();

System.exit(1);

}

 

System.out.println("==================== Start call inceptor procedure ====================");

// Hive2 JDBC URL with LDAP

String jdbcURL = "jdbc:hive2://ip:10000/default";

 

Connection conn = DriverManager.getConnection(jdbcURL,"username","password");

Statement stmt = conn.createStatement();

// 调用存储过程

stmt.execute("call transdata('20160630')");

stmt.close();

conn.close();

System.out.println("==================== End  call  inceptor procedure ====================");

}

}

相关文章:

  • 2021-06-21
  • 2021-10-10
  • 2021-12-25
  • 2021-10-26
  • 2021-08-20
  • 2021-11-01
  • 2021-11-18
  • 2021-07-22
猜你喜欢
  • 2021-07-30
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案