Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

i'm developing a java program with a pom file which lets me to connect to Hive from my HDP 2.4 using Jdbc, but i didn't know what are the dependencies required for that

Highlighted

i'm developing a java program with a pom file which lets me to connect to Hive from my HDP 2.4 using Jdbc, but i didn't know what are the dependencies required for that

New Contributor
 
3 REPLIES 3

Re: i'm developing a java program with a pom file which lets me to connect to Hive from my HDP 2.4 using Jdbc, but i didn't know what are the dependencies required for that

try these dependencies in your pom

<dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-exec</artifactId>
        <version>1.2.1000.2.4.0.0-153</version>
    </dependency>
    <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-jdbc</artifactId>
        <version>1.2.1000.2.4.0.0-153</version>
    </dependency>
    <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-metastore</artifactId>
        <version>1.2.1000.2.4.0.0-153</version>
    </dependency>
    <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-service</artifactId>
        <version>1.2.1000.2.4.0.0-153</version>
    </dependency>
    <dependency>
        <groupId>org.apache.calcite</groupId>
        <artifactId>calcite-avatica</artifactId>
        <version>1.2.0.2.4.0.0-153</version>
    </dependency>
    <dependency>
        <groupId>org.apache.calcite</groupId>
        <artifactId>calcite-core</artifactId>
        <version>1.2.0.2.4.0.0-153</version>
    </dependency>
    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-common</artifactId>
        <version>2.7.1.2.4.0.0-153</version>
    </dependency>

for specific version of hdp you can refer the dependencies from http://nexus-private.hortonworks.com/nexus/content/groups/public/

Re: i'm developing a java program with a pom file which lets me to connect to Hive from my HDP 2.4 using Jdbc, but i didn't know what are the dependencies required for that

New Contributor

i had this error:

java.lang.ClassNotFoundException: org.apache.hadoop.hive.jdbc.HiveDriver at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at Model.HiveConnection.main(HiveConnection.java:15)

Re: i'm developing a java program with a pom file which lets me to connect to Hive from my HDP 2.4 using Jdbc, but i didn't know what are the dependencies required for that

Master Collaborator

I am guessing you are getting this at runtime, you should include the following jars in your classpath:

$HIVE_HOME/lib/hive-jdbc.jar

$HADOOP_HOME/lib/hadoop-common.jar

Don't have an account?
Coming from Hortonworks? Activate your account here