Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with the problem of error reporting when java calls zookeeper mode

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "java call zookeeper mode error problem how to deal with", the article explains the content is simple and clear, easy to learn and understand, now please follow the editor's train of thought slowly in depth, together to study and learn "java call zookeeper mode error problem how to deal with" it!

1. Invocation mode zookeeper mode call

/ * * @ Title TestHive.java*@description TODO*@time in the afternoon of December 24, 2020 1:27:38*@version 1.0**/package org.thedatamanager.dataCollectionService;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement / * * * / public class TestHive {/ * * * @ Title: main * @ Description: * @ param args * @ return void * @ date 1:27:38 on 24 December 2020 * / public static void main (String [] args) {try { Class.forName ("org.apache.hive.jdbc.HiveDriver") / / Connection conn = DriverManager.getConnection ("jdbc:hive2://10.60.127.131:10000", "hive", ""); / / Connection conn = DriverManager.getConnection ("jdbc:hive2://192.168.1.135:10000/default;auth=noSasl", "hive", "hive") Connection conn = DriverManager.getConnection ("jdbc:hive2://192.168.1.134:2181192.168.1.135:2181192.168.1.136:2181/default;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2", "root", "root"); / / default is the database name of hive Statement stmt = conn.createStatement (); String querySQL= "show databases" ResultSet res = stmt.executeQuery (querySQL); while (res.next ()) {System.out.println (res.getString (1));}} catch (ClassNotFoundException e) {e.printStackTrace () } catch (SQLException e) {e.printStackTrace ();}

Error class undefined can't find curator connection

two。 problem

Solution: introduce the removal of the lower version of curator-client from the lower version of hive-jdbc into the higher version of 4.0.1

Org.apache.hive hive-jdbc 3.1.0 ch.qos.logback logback-classic Org.apache.logging.log4j log4j-slf4j-impl org.slf4j Slf4j-log4j12 org.eclipse.jetty * Org.eclipse.jetty.orbit * org.eclipse.jetty.aggregate * tomcat * Javax.servlet servlet-api org.mortbay.jetty * Org.apache.curator curator-client Org.apache.curator curator-client 4.0.1 Thank you for your reading The above is the content of "how to deal with the error problem of java calling zookeeper mode". After the study of this article, I believe you have a deeper understanding of how to deal with the problem of java calling zookeeper mode error report, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report