Hive Server Address Java — Upd
implementation 'org.apache.hive:hive-jdbc:3.1.3' hive-jdbc pulls Hadoop & Hive dependencies – make sure versions match your server. 4. Full Java Connection Example (No Authentication) For development clusters without Kerberos/LDAP:
// No username/password required with auth=noSasl try (Connection conn = DriverManager.getConnection(jdbcUrl, "", ""); Statement stmt = conn.createStatement()) String sql = "SHOW TABLES"; ResultSet rs = stmt.executeQuery(sql); while (rs.next()) System.out.println(rs.getString(1)); hive server address java
Always match hive-jdbc version with your server’s Hive version, and test first with beeline . implementation 'org
beeline -u "jdbc:hive2://<host>:<port>/<db>;principal=hive/_HOST@REALM" If beeline works, your Java code will too. | Component | Value / Pattern | |--------------------|-------------------------------------------------------| | JDBC prefix | jdbc:hive2:// | | Host:Port | <hive-server>:10000 (or HTTP 10001) | | Auth param | auth=noSasl / principal=... / user=... | | Transport mode | binary (default) or transportMode=http | | HA (ZooKeeper) | serviceDiscoveryMode=zooKeeper + ZooKeeper hosts | | Java driver | org.apache.hive.jdbc.HiveDriver (auto-loaded) | | | Transport mode | binary (default) or