java操作impala
public class App { static String JDBC_DRIVER = "com.cloudera.impala.jdbc4.Driver"; static String CONNECTION_URL = "jdbc:impala://192.168.6.138:21050/default"; public static void main(String[] args) { Connection con = null; ResultSet rs = null; PreparedStatement ps = null; try { Class.forName(JDBC_DRIVER); con = DriverManager.getConnection(CONNECTION_URL); ps = con.prepareStatement("show databases"); rs = ps.executeQuery(); while (rs.next()) { System.out.println(rs.getString(1)); } rs.close(); ps.close(); con.close(); } catch (Exception e) { e.printStackTrace(); } finally { } } }
impala_jdbc下载地址:
https://downloads.cloudera.com/connectors/impala_jdbc_2.5.42.1062.zip
https://www.cloudera.com/downloads/connectors/impala/jdbc/2-5-43.html