Monthly Archives: November 2015

Connection Impala from Java Application

Here is how you can add a connection to Hadoop from java
// Step 1: Load the JDBC driver.
Class.forName(“com.cloudera.impala.jdbc4.Driver”);
System.out.println(“Driver Loaded.”);
// Step 2: Establish the connection to the database.
//String url = “jdbc:impala://hostname:21050″;
String url = “jdbc:impala://hostanem:21050/default;auth=noSasl”;
String username = “”;
String password = “”;

connection = DriverManager.getConnection(url, null, null);
System.out.println(“Got Connection.”);
System.out.println();

Or connection = DriverManager.getConnection(url, username, password);
Or connection = DriverManager.getConnection(url);