开发者

Running cx_Oracle under jython on tomcat

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜