Adding the Phoenix JDBC driver jar

Learn how to add the Phoenix JDBC driver jar to the classpath.

The Phoenix JDBC client is built on top of the HBase client and has an unusually high number of dependencies. To make this manageable, Phoenix provides a single shaded uberjar that can be added to the classpath.

Phoenix uses some private and semi-public HBase APIs, which may change between HBase versions, and provides separate binary distributions for use with different HBase versions.

You must consider the driver JARs from the binary distribution (Phoenix downloads) or maven artifact corresponding to the HBase version on the cluster. See Binary distribution: Phoenix downloads.
  1. Download the driver JAR from the binary distribution location.
    Copy the corresponding phoenix-client-embedded-hbase-[hbase.profile]-[phoenix.version].jar to the application classpath.
  2. Add the dependency through Maven.
    <dependencies>
        ...
        <dependency>
            <groupId>org.apache.phoenix</groupId>
            <artifactId>phoenix-client-embedded-hbase-[hbase.profile]</artifactId>
            <version>[phoenix.version]</version>
        </dependency>
        ...
      </dependencies>