Related Entries

India PyCon 2009
Quick wallpaper changer
Load testing with Grinder
Adding namespace to XML
Opera RSS to OPML

« This one is for bookmarks
» Interactive Python - notes

Jython zxJDBC rocks!

Jython with zxJDBC makes life so much easier for data maintenance scripts.

I usually use cxOracle from Python for accessing Oracle. Today, I tried using Jython. It is as easy as using CPython.

I really liked zxJDBC. Especially the dbexts wrapper - makes it much easier to write portable code by moving DB parameters to a configuration file.

Instead of writing about how I used it, I recommend Database Development in Jython with zxJDBC by Robert Bill.

Jythonc is a little utility that can compile Jython classes to Java classes. It also generates a Java source file in the process. Since SQLJ syntax is like #sql sql statement, I’m wondering if there is some tweak I can do to create .java files from .py and then compile it using sqlj. Jython compiler shouldn’t complain since #sql will be considered a Python comment. To be fair, the only advantage I can think of is that the source code will be much smaller (Rob Clevenger says Python is white space oriented; OK, I like white spaces in Python - anyway I add those in Java/C/C# on top of {} and semi-colons :-))

Performance is fractionally lesser than Java+JDBC or CPython+cxOracle. I can live with that for the current needs.