好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Python实现连接phoenix的实例

这篇文章主要介绍了Python连接phoenix的方法,简单说明了phoenix的概念、功能并结合具体实例形式分析了Python连接phoenix的相关操作技巧,需要的朋友可以参考下

import jpype
import jaydebeapi
import os
phoenix_client_jar="/data/users/huser/phoenix/phoenix-4.3.0-client.jar"
args=='-Djava.class.path=%s'% phoenix_client_jar
jvm_path=jpype.getDefaultJVMPath()
jpype.startJVM(jvm_path,args)
conn=jaydebeapi.connect('org.apache.phoenix.jdbc.PhoenixDriver',['jdbc:phoenix:bj-g2hdp1,bj-g2hdp2,bj-g2hdp3:2181','',''],phoenix_clinent_jar)
curs=conn.cursor()
sql="select * from test"
count=curs.execute(sql)
results=curs.fetchall()
for r in results:
  print r 

以上就是Python实现连接phoenix的实例的详细内容,更多请关注Gxl网其它相关文章!

查看更多关于Python实现连接phoenix的实例的详细内容...

  阅读:38次