Error while executing program with Hive JDBC

前端 未结 2 979
悲哀的现实
悲哀的现实 2021-01-20 22:40

I have written this small program for Hive JDBC. Initially it is executing fine but when I tried to run now suddenly I got error.

Program:

import j         


        
2条回答
  •  情书的邮戳
    2021-01-20 22:55

    I faced the same error when I was trying run a sample JDBC against HIVE. I then added the location of libfb*.jar to the classpath & it worked fine for me. What I've learnt from the JDBC execution is that it requires a whole load of jar files which need to be explicitly mentioned in the classpath. My classpath looked something like this (the last few jars are absolutely required for the JDBC to execute)

    [cloudera@quickstart ownjava]$ echo $CLASSPATH
    /etc/hadoop/conf:/usr/lib/hadoop/lib/*:/usr/lib/hadoop/.//*:/usr/lib/hadoop-hdfs/./:/usr/lib/hadoop-hdfs/lib/*:/usr/lib/hadoop-hdfs/.//*:/usr/lib/hadoop-yarn/lib/*:/usr/lib/hadoop-yarn/.//*:/usr/lib/hadoop-mapreduce/lib/*:/usr/lib/hadoop-mapreduce/.//*:/usr/lib/hive/lib/:/usr/lib/hive/lib/hive-exec.jar:/usr/lib/hive/lib/hive-exec-0.12.0-cdh5.1.0.jar:/usr/lib/hive/lib/hive-service.jar:/usr/lib/hive/lib/hive-service-0.12.0-cdh5.1.0.jar:/usr/lib/hive/lib/hive-metastore.jar:/usr/lib/hive/lib/hive-metastore-0.12.0-cdh5.1.0.jar:/home/cloudera/ownjava/:/usr/lib/hive/lib/hive-jdbc-0.12.0-cdh5.1.0.jar:/usr/lib/hive/lib/hive-jdbc.jar:/usr/lib/hive/lib/libfb303-0.9.0.jar:/usr/lib/hive/lib/jdo-api-3.0.1.jar:/usr/lib/hive/lib/antlr-runtime-3.4.jar
    

提交回复
热议问题