haha, I sent the same question a few days before, no response yet.but I find a way to operate hive remotely

use Jsch framework to ssh on the hive machine, and execute whatever sql by using "hive -e select ... &", then the query will run background.if you want to know when the query finished, a little complexity, use Jsch to execute "hive -e select ... >> result.csv &"thenstart a thread, use Jsch to execute "mv result.csv result.c" every 3 mins, you can know if the mv successful by call Jsch APIif success, then the query ends

> **> haha, I sent the same question a few days before, no response yet.> but I find a way to operate hive remotely>> use Jsch framework to ssh on the hive machine, and execute whatever sql> by using "hive -e select ... &", then the query will run background.> if you want to know when the query finished, a little complexity,> use Jsch to execute "hive -e select ... >> result.csv &"> then> start a thread, use Jsch to execute "mv result.csv result.c" every 3 mins,> you can know if the mv successful by call Jsch API> if success, then the query ends>> 2013-06-26> ------------------------------> kentkong_work> ------------------------------> *发件人：*Christian Schneider <[EMAIL PROTECTED]>> *发送时间：*2013-06-26 21:21> *主题：*How to connect to HiveServer 2? (Only through JDBC?)> *收件人：*"user"<[EMAIL PROTECTED]>> *抄送：*>> Hi,> is JDBC the only way to connect to HiveServer 2?>> I can't find any documentation how to do it with java?>> There is a Thrift port open, but how to use that?>> Best Regards,> Christian.>

Funny :). But that's really a ugly hack :). I don't know whether i should suggest this :).

2013/6/26 kentkong_work <[EMAIL PROTECTED]>

haha, I sent the same question a few days before, no response yet.but I find a way to operate hive remotely

use Jsch framework to ssh on the hive machine, and execute whatever sql by using "hive -e select ... &", then the query will run background.if you want to know when the query finished, a little complexity, use Jsch to execute "hive -e select ... >> result.csv &"thenstart a thread, use Jsch to execute "mv result.csv result.c" every 3 mins, you can know if the mv successful by call Jsch APIif success, then the query ends