Reputation: 45
I try to make Oracle request in python from Raspberry pi. The problem is:
"Oracle does not support the ARM CPU architecture which the Raspberry Pi uses. You downloaded and unzipped the Oracle Instant Client, but it can't actually run. And without the Oracle Client libraries, cx_oracle will not work, and neither will generic Python ODBC connectors."
But I need python, so installed JPype and JayDeBeApi and I wrote this on jupyter notebopok:
import jaydebeapi
import jpype
from jpype import *
classpath="ava-1.5.0-gcj-6-armhf"
jvm_path = "/usr/lib/jvm/java-1.5.0-gcj-6-armhf/lib"
jHome = jpype.getDefaultJVMPath()
print(jHome)
/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/arm/client/libjvm.so
conn=jaydebeapi.connect('oracle.jdbc.driver.OracleDriver','[admin]/[root]@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=helloworld.com)(PORT=1521))(CONNECT_DATA=(SID=hello42)))')
but I have this error:
AttributeError Traceback (most recent call last)
<ipython-input-34-82d7959b353e> in <module>
----> 1 conn=jaydebeapi.connect('oracle.jdbc.driver.OracleDriver','[admin]/[root]@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=helloworld.com)(PORT=1521))(CONNECT_DATA=(SID=hello42)))')
/usr/local/lib/python3.5/dist-packages/jaydebeapi/__init__.py in connect(jclassname, url, driver_args, jars, libs)
379 else:
380 libs = []
--> 381 jconn = _jdbc_connect(jclassname, url, driver_args, jars, libs)
382 return Connection(jconn, _converters)
383
/usr/local/lib/python3.5/dist-packages/jaydebeapi/__init__.py in _jdbc_connect_jpype(jclassname, url, driver_args, jars, libs)
181 types_map = {}
182 for i in types.__javaclass__.getClassFields():
--> 183 types_map[i.getName()] = i.getStaticAttribute()
184 _init_types(types_map)
185 global _java_array_byte
AttributeError: '_jpype.PyJPField' object has no attribute 'getStaticAttribute'
how to fix that?
Upvotes: 1
Views: 2371
Reputation: 519
What JPype version do you use? There was a new version released last week. If you are using version 0.7.0 try the previous version 0.6.3
Upvotes: 4