HBASE Phoenix & Java: Unsecure Connection

(Last Updated On: )

In this tutorial I will show you how to do a basic connection to remote unsecure HBase Pheonix Query Server using Java. Phoenix allows you to run SQL commands over top HBASE. You can find the commands listed here.

POM.xml:

  1. <dependency>
  2. <groupId>org.apache.phoenix</groupId>
  3. <artifactId>phoenix-server-client</artifactId>
  4. <version>4.7.0-HBase-1.1</version>
  5. </dependency>

Imports:

  1. import java.sql.DriverManager;
  2. import java.sql.SQLException;

Connect:

  1. Class.forName("org.apache.phoenix.queryserver.client.Driver");
  2. Connection conn = DriverManager.getConnection("jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF");