views:

30

answers:

1

Hi

I'm trying to load cx_Oracle using tomcat.

Loading from python works fine, but for jython I'm getting "module not found". My system.path includes site-packages that contains cx_Oracle.so.

I'm new to jython and I've not had time to familiarize myself with all the variables but I believe I have all the necessary environment variables exported, though clearly something is amiss.

+2  A: 

Ben, not all modules that work with Python in CPython implementation will work on other implementations. If such module use system specific calls, or binds to some .dll/.so file it will not work on other Python implementation. cx_Oracle is one os such modules: it binds to Oracle client (there are cx_Oracle versions for various Oracle versions and various operational systems).

I think you should use JDBC driver if you want to access Oracle from Jython. Then you can use JDBC calls, or use zxJDBC Jython module that makes JDBC drivers available via DB API calls. I used both JDBC (with zxJDBC) and cx_Oracle in programs that can work from CPython and Jython. To see it in action look to my recipe to dump Oracle db schema to text

Michał Niklas