发布时间:2019-09-24 08:20:59编辑:auto阅读(2603)
这里我们通过Jpype和JayDeBeApi 来连接
这里我列出实例代码:
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测试dubbo接口
下一篇: python 操作crontab 实现
50953
50333
40953
37817
32283
29173
28059
22889
22853
21185
1037°
1717°
1403°
1337°
1597°
1433°
2087°
3628°
3545°
2502°