Calling Java Code from CPython (1.5.2 or 2.0)
Gerhard Häring
gerhard.nospam at bigfoot.de
Fri Jan 12 09:42:00 EST 2001
If all you want to do is access databases from Python, there are Python
modules to do that for all the major databases. Best look at the database
topic guide at www.python.org. No need for JDBC here.
If for any other reason you still need to connect Python and Java, I have to
disappoint you: there is no easy way to do this that I know of. For
difficult ways, there would be several:
- CORBA
- JNI (Java Native Interface): this requires that you write a C DLL that
interfaces Java and you call into that DLL from Python code. Very awkward.
- JPython: I guess that there is a relatively simple way to talk from
CPython to JPython/Jython, there is Pyro which presumably works with
JPython, and IIRC there is something like Python RPC.
But a simple way I do not know :-(
Gerhard
On Fri, 12 Jan 2001 08:58:43 +0100, Dario Lopez-Kästen wrote:
>Hello!
>
><newbie class="clueless">
>
>I would like to know if it is possible to call Java Code from CPython (as in
>not Jython or JPython). I am asking this, because i'd like to be able to
>experiment using JDBC in conjunction with python; specifically, I want to
>use Zope and JDBC drivers on Solaris/Linux and that "other" operating system
>to connect to Oracle, MIMER and some other DBMSs we have.
>
>There is one JDBC database adapter for JPython, but I don't know if it is
>possible to mix JPython/Jython with CPython.
>
></newbie>
>
>I have searched the archives but all references to Java and Python end up in
>Jython/JPython.
>
>I might add that I am a new Python user and haven't really had time to do
>anythin usefull so far; therefore, any help is appreciated.
--
mail: gerhard <at> bigfoot <dot> de
web: http://highqualdev.com
More information about the Python-list
mailing list