Settings for SQL querying:
driverName = "org.apache.hive.jdbc.HiveDriver"; connectionUrl = "jdbc:hive2://" + webPortalIp + ":" + webPortalPort+ "/;transportMode=http;httpPath=kyvos/sql"; Username = Username of Kyvos webportal; Password = Password of Kyvos webportal; public static java.sql.Connection getSQLConnection(String driverName,String connectionUrl,String Username,String Password) throws ClassNotFoundException, SQLException { try { Class.forName(driverName); } catch (Exception e) { e.printStackTrace(); } return java.sql.DriverManager.getConnection(connectionUrl,Username, Password); }
This will return the connection object through which user can run SQL query using JDBC connection.