Could you please enlighten me on how to connect to an Oracle instance using Python/Jython ?
After installing fully Jython, the Oracle website (http://www.oracle.com/technetwork/articles/dsl/mastering-oracle-python-providers-1395759.html) suggests to : All you need to provide is to make sure ojdbc6.jar is in the CLASSPATH or JYTHONPATH so that the connection driver could be resolved.
I read that when using the -jar option ignores the CLASSPATH environment variable. So I did like :
java -classpath /usr/lib/oracle/12.1/client64/lib/ojdbc6.jar -jar jython.jar
from java.sql import DriverManager
db_connection = DriverManager.getConnection("jdbc:oracle:thin:@xxxxx:1521/P1FNTPE", "xxx", "xxx")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
at java.sql.DriverManager.getConnection(DriverManager.java:596)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
java.sql.SQLException: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@xxxxx:1521/P1FNTPE
Could you please help/advise me on how to resolve this issue ?