hive jdbc连接需要引入的jar包

如果不引入最后两个包会报错:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/map/UnmodifiableMap

at org.apache.hadoop.conf.Configuration$DeprecationContext.<init>(Configuration.java:394)
at org.apache.hadoop.conf.Configuration.<clinit>(Configuration.java:432)
at org.apache.hadoop.hive.jdbc.HiveQueryResultSet.initSerde(HiveQueryResultSet.java:111)
at org.apache.hadoop.hive.jdbc.HiveQueryResultSet.<init>(HiveQueryResultSet.java:66)
at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:198)
at org.apache.hadoop.hive.jdbc.HiveStatement.execute(HiveStatement.java:132)
at org.apache.hadoop.hive.jdbc.HiveConnection.configureConnection(HiveConnection.java:132)
at org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:122)
at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:106)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.yinhai.hive.HiveConnTest.main(HiveConnTest.java:25)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.map.UnmodifiableMap
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 12 more

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页