JDBC 连连Hive报错:Connection reset

最近在学习Hive,发现在Eclipse中通过JDBC方式连接Hive报错(报错的信息如下),一直找不到原因,偶然的一次又能连接成功。发现原因可能是打开了Hive Shell,后来把Hive Shell和Hive Web UI关了又试了几次,没有再报错应该是这个原因:Hive Shell 、Hive Web UI及JDBC 三种连接Hive Server的方式是互斥的,同一时刻只能用一种方式连接。 Mark一下。。

java.sql.SQLException: org.apache.thrift.transport.TTransportException: java.net.SocketException: Connection reset
	at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:191)
	at org.apache.hadoop.hive.jdbc.HiveStatement.execute(HiveStatement.java:127)
	at org.apache.hadoop.hive.jdbc.HiveConnection.configureConnection(HiveConnection.java:126)
	at org.apache.hadoop.hive.jdbc.HiveConnection.(HiveConnection.java:121)
	at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:104)
	at java.sql.DriverManager.getConnection(DriverManager.java:582)
	at java.sql.DriverManager.getConnection(DriverManager.java:185)
	at com.buptsse.brandtracker.data.HcCsvGenerator.main(HcCsvGenerator.java:175)


你可能感兴趣的:(JDBC 连连Hive报错:Connection reset)