And this list does not specify a reply-to header... so here is my response to Helmut for public knowledge.

---------- Forwarded message ----------
From: Tobias Ivarsson <>
Date: Mon, Jul 21, 2008 at 5:54 PM
Subject: Re: [Jython-users] newbee - howto specify path to java classes
To: Helmut Jarausch <>

In order to be able to load the jar the JVM has to be able to find it. Jars are located using the classpath configuration variable, you can specify your classpath when you start java like this:
java -classpath /usr/share/hsqldb/lib/something.jar:/usr/share/hsqldb/lib/another.jar org.pyton.util.jython

I don't know how the jdbc service registration system works but it might be possible to do it all in pure python code in jython as well:
import sys
import org.hsqldb.jdbcDriver
from java.sql import DriverManager

con = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost", "sa", "")

There are a few options for embedding Java in CPython:
 * JPype, uses JNI to access the Java reflection api from Python and adds some layer of Python code on top of it to make Java objects feel more like Python objects.
 * JCC, generates C-code for a CPython extension that provides access to a specified set of Java classes through JNI. Used by the PyLucene project.

I have used JPype quite sucessfully. JCC gets better performance, but is much harder to work with.
Neither JPype nor JCC have good support for sharing one Java process in between several CPython processes, making Jython the best option for concurrent applications.


On Mon, Jul 21, 2008 at 5:31 PM, Helmut Jarausch <> wrote:

being a complete newbee I wonder how I can
tell jython to load e.g.

I'm trying to run the hsqldb

import java
from java.sql import *
from  import *

# but the following statement fails

con = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost", "sa", "")

Many thanks for a hint!

If there is a possibility to use hsqldb from CPython I would
prefer that very much.


Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Jython-users mailing list