jython 2 cpython bridge

R

Randall Smith

I would like to use a type 4 JDBC driver in my Python program. I
believe I can use in with Jython. Do you know of some way to
communicate between the Jython and Python processes so that the CPython
program can use the Jython JDBC database connection?

Randall
 
I

Irmen de Jong

Randall said:
I would like to use a type 4 JDBC driver in my Python program. I
believe I can use in with Jython. Do you know of some way to
communicate between the Jython and Python processes so that the CPython
program can use the Jython JDBC database connection?

Create some form of IPC between the two, for instance using xmlrpc.

--Irmen

PS: I would have suggested to use Pyro, but:
- Java/Jython doesn't have the select() system call that Pyro needs for a server,
- There are bugs in Jython that make it crash when compiling Pyro's source.
 
T

tertius

Randall said:
I would like to use a type 4 JDBC driver in my Python program. I
believe I can use in with Jython. Do you know of some way to
communicate between the Jython and Python processes so that the CPython
program can use the Jython JDBC database connection?

Randall

Write the application using Jython. Then use SimpleXMLRPCServer on the
Jython side to register the necessary functions for an XML-RPC client
written in Python.

HTH
T
 
S

Steve Menard

Irmen said:
Create some form of IPC between the two, for instance using xmlrpc.

--Irmen

PS: I would have suggested to use Pyro, but:
- Java/Jython doesn't have the select() system call that Pyro needs for
a server,
- There are bugs in Jython that make it crash when compiling Pyro's
source.

<shameless plug>
Alternately, you can look at JPype ( http://jpype.sourceforge.net ).

It is still a very early release, but I would welcome any feeback. And
version 0.1 should allow you to use JDBC without problem.

It currently only works on Windows, but if there is interest, I could
make a linux release pretty quickly.

</shameless plug>
 
J

John J. Lee

Steve Menard said:
Alternately, you can look at JPype ( http://jpype.sourceforge.net ).

It is still a very early release, but I would welcome any feeback. And
version 0.1 should allow you to use JDBC without problem.

It currently only works on Windows, but if there is interest, I could
make a linux release pretty quickly.

I assume you've seen JPE?

How does / will JPype differ from that?

I *think* JPE hasn't been maintained for quite a while, but I'm not
certain what its current state is.


John
 
S

Steve Menard

John said:
I assume you've seen JPE?

How does / will JPype differ from that?

I *think* JPE hasn't been maintained for quite a while, but I'm not
certain what its current state is.


John

Yes I have seen JPE. However, from the my admitedly quick look, it
didn't allow the seemless integration I am looking for. Either that, or
the samples did show off what JPE could do.

Besides I intend to take JPype beyonf Python->Java integration, and
choice is always good :)

Steve
 
J

John J. Lee

Steve Menard said:
Besides I intend to take JPype beyonf Python->Java integration, and
choice is always good :)

Especially when the closest alternative is unmaintained! I've
certainly wanted something like this in the past.

Good luck with your project.


John
 
N

Nicolas Lehuen

Steve Menard said:
<shameless plug>
Alternately, you can look at JPype ( http://jpype.sourceforge.net ).

It is still a very early release, but I would welcome any feeback. And
version 0.1 should allow you to use JDBC without problem.

It currently only works on Windows, but if there is interest, I could
make a linux release pretty quickly.

</shameless plug>

That's awesome ! This is still a little bit rough on the edges, but it
already works well enough to have an idea of what it could bring to
Python.

This is what I mean by 'rough on the edge' : launching a Python
program using JPype from a .py file is OK, but using the prompt is
weird :
File "<stdin>", line 1
1+1
^
SyntaxError: invalid syntax File "<stdin>", line 1
help()
^
SyntaxError: invalid syntax

Anyway, this is extremely promising. Soon, we'll be able to seamlessly
use Java object thanks to JPype, as we do with COM objects using
win32all or ctypes. Python is THE real integration/composition
platform !

Thanks for your work, Steve.

Regards,
Nicolas
 
S

Steve M?nard

(e-mail address removed) (Nicolas Lehuen) wrote in message
That's awesome ! This is still a little bit rough on the edges, but it
already works well enough to have an idea of what it could bring to
Python.

This is what I mean by 'rough on the edge' : launching a Python
program using JPype from a .py file is OK, but using the prompt is
weird :

File "<stdin>", line 1
1+1
^
SyntaxError: invalid syntax
File "<stdin>", line 1
help()
^
SyntaxError: invalid syntax

Anyway, this is extremely promising. Soon, we'll be able to seamlessly
use Java object thanks to JPype, as we do with COM objects using
win32all or ctypes. Python is THE real integration/composition
platform !

Thanks for your work, Steve.

Regards,
Nicolas

Thanks for your enthusiasm, and for the feedback.

However, I have tried what you've described above, and had no problem.
further An invalid syntax is usually something thrown by the parser,
way before any JPype-related code sees the commands.

If the problem persists, can you enter a bug report at JPype's
souceforge project page? ( http://sourceforge.net/projects/jpype/ )

I would like to use SF's tracking features to keep everyone up to date
on what is going on. As a matter of fact you'll be able to track each
releases progress by looking at the task list.

Again, thanks for your interest.

Steve Ménard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top