Open yyccww123 opened 7 years ago
new problem:
Traceback (most recent call last):
File "
You can decompile your db jar then copy it to org folder of jython. It works on sqlite-jdbc
Have you solve the problem? Can you list your solution procedures?
cmd : /usr/hdp/current/phoenix-client/bin/sqlline.py is work.
---------use phoenixdb is work, but It does not support kerberos. import phoenixdb import phoenixdb.cursor conn = phoenixdb.connect('http://localhost:8765', autocommit=True) cursor = conn.cursor() cursor.execute("SELECT count(1) FROM WILL_TEST5") print cursor.fetchone()[0]
I'm going to use jaydebeapi to connect to phoenix by jdbc.
import jaydebeapi conn = jaydebeapi.connect('org.apache.phoenix.jdbc.PhoenixDriver',['jdbc:phoenix:localhost:8765:/hbase-unsecure','', ''], '/usr/hdp/current/phoenix-client/phoenix-client.jar')
--Error: Traceback (most recent call last): File "", line 1, in
File "build/bdist.linux-x86_64/egg/jaydebeapi/init.py", line 381, in connect
File "build/bdist.linux-x86_64/egg/jaydebeapi/init.py", line 190, in _jdbc_connect_jpype
File "/usr/lib64/python2.7/site-packages/JPype1-0.6.2-py2.7-linux-x86_64.egg/jpype/_jclass.py", line 55, in JClass
raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
jpype._jexception.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class org.apache.phoenix.jdbc.PhoenixDriver not found
-- import jaydebeapi conn = jaydebeapi.connect('org.apache.phoenix.jdbc.PhoenixDriver',['jdbc:phoenix:oc-etl-data-new-118,oc-etl-data-new-128,oc-etl-data-new-129:2181:/hbase-secure:ocdp/ocdp@ynmobile.com:/home/ocdp/keytabs/ocdp.keytab', '', ''],'/usr/hdp/current/phoenix-client/phoenix-client.jar')
error:
Traceback (most recent call last): File "", line 1, in
File "build/bdist.linux-x86_64/egg/jaydebeapi/init.py", line 381, in connect
File "build/bdist.linux-x86_64/egg/jaydebeapi/init.py", line 199, in _jdbc_connect_jpype
RuntimeError: No matching overloads found. at native/common/jp_method.cpp:117