472,977 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,977 software developers and data experts.

jython 2 cpython bridge

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
Jul 18 '05 #1
10 2101
Randall Smith wrote:
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
Jul 18 '05 #2
Randall Smith wrote:
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.
Jul 18 '05 #3
Irmen de Jong wrote:
Randall Smith wrote:
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.


<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>
Jul 18 '05 #4
Alternately, you can look at JPype ( http://jpype.sourceforge.net ).

Wow. Cool idea :-)

Ciao,
Dominic
Jul 18 '05 #5
Steve Menard <st**********@videotron.ca> writes:
[...]
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
Jul 18 '05 #6
John J. Lee wrote:
Steve Menard <st**********@videotron.ca> writes:
[...]
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


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
Jul 18 '05 #7
Steve Menard <st**********@videotron.ca> writes:
[...]
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
Jul 18 '05 #8
Steve Menard <st**********@videotron.ca> wrote in message news:<zt*********************@wagner.videotron.net >...
Irmen de Jong wrote:
Randall Smith wrote:
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.


<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 :
from jpype import *
startJVM(r"C:\j2sdk1.4.2_03\jre\bin\client\jvm.dll ", "-ea")
1+1 File "<stdin>", line 1
1+1
^
SyntaxError: invalid syntax help()

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
Jul 18 '05 #9
ni*****@lehuen.com (Nicolas Lehuen) wrote in message
<<snip>>

<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 :
from jpype import *
startJVM(r"C:\j2sdk1.4.2_03\jre\bin\client\jvm.dll ", "-ea")
1+1 File "<stdin>", line 1
1+1
^
SyntaxError: invalid syntax help()

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
Jul 18 '05 #10
How about Spiro?

http://www.freenet.org.nz/python/spiro/

Randall Smith <ra*****@tnr.cc> wrote in message news:<8dssc.179150$f_5.163363@lakeread01>...
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

Jul 18 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Chermside | last post by:
Ype writes: > For the namespaces in Jython this 'Python internal thread safety' > is handled by the Java class: > > http://www.jython.org/docs/javadoc/org/python/core/PyStringMap.html > > which...
6
by: Dave Benjamin | last post by:
Hey good people, I've been doing a lot of simultaneous Jython and CPython programming lately, and just wanted to say, with no intended ill will toward any of the individuals who have been...
4
by: angel | last post by:
A java runtime environment includes jvm and java class (for example classes.zip in sun jre). Of course jython need jvm,but does it need java class. Thanx
11
by: Maurice LING | last post by:
Hi, I'm looking for a suitable thesis topic, so I hope that I can gather some advice on this area that I'm thinking of. Jython appears as a relatively successful attempt to bridge Python to...
5
by: Maurice Ling | last post by:
Hi, I have read that this had been asked before but there's no satisfactory replies then. I have a module (pA) written in python, which originally is called by another python module (pB), and...
3
by: Jim Hargrave | last post by:
I've read that it is possible to compile jython to native code using GCJ. PyLucene uses this approach, they then use SWIG to create a Python wrapper around the natively compiled (java) Lucene. Has...
4
by: Ramza Brown | last post by:
This is an update from Brian Zimmer of the Jython group, new release: "There is a new release of Jython available at Sourceforge: http://sourceforge.net/project/showfiles.php?group_id=12867 ...
3
by: Gerard Flanagan | last post by:
Hello all I have a 'logger' module which is essentially just a facade over the 'logging' standard module. Can this be called from jython, and how is this acheived? This is a colleague's question...
2
by: Felipe De Bene | last post by:
Hi There, I'm trying to run an App I wrote in Python 2.5.2 in Jython 2.2.1 and everything works fine except when I try to import the Standard CPython's cookielib. I know this may sound stupid, I...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.