jython 2 cpython bridge

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Randall Smith

    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
  • tertius

    #2
    Re: jython 2 cpython bridge

    Randall Smith wrote:[color=blue]
    > 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[/color]

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

    HTH
    T

    Comment

    • Irmen de Jong

      #3
      Re: jython 2 cpython bridge

      Randall Smith wrote:
      [color=blue]
      > 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?[/color]

      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.

      Comment

      • Steve Menard

        #4
        Re: jython 2 cpython bridge

        Irmen de Jong wrote:[color=blue]
        > Randall Smith wrote:
        >[color=green]
        >> 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?[/color]
        >
        >
        > 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.[/color]

        <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>

        Comment

        • Dominic

          #5
          Re: jython 2 cpython bridge

          [color=blue]
          > Alternately, you can look at JPype ( http://jpype.sourceforge.net ).[/color]
          Wow. Cool idea :-)

          Ciao,
          Dominic

          Comment

          • John J. Lee

            #6
            Re: jython 2 cpython bridge

            Steve Menard <steve.menard@v ideotron.ca> writes:
            [...][color=blue]
            > 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.[/color]

            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

            Comment

            • Steve Menard

              #7
              Re: jython 2 cpython bridge

              John J. Lee wrote:[color=blue]
              > Steve Menard <steve.menard@v ideotron.ca> writes:
              > [...]
              >[color=green]
              >>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.[/color]
              >
              >
              > 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[/color]

              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

              Comment

              • John J. Lee

                #8
                Re: jython 2 cpython bridge

                Steve Menard <steve.menard@v ideotron.ca> writes:
                [...][color=blue]
                > Besides I intend to take JPype beyonf Python->Java integration, and
                > choice is always good :)[/color]

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

                Good luck with your project.


                John

                Comment

                • Nicolas Lehuen

                  #9
                  Re: jython 2 cpython bridge

                  Steve Menard <steve.menard@v ideotron.ca> wrote in message news:<ztHsc.424 67$Fk4.1873925@ wagner.videotro n.net>...[color=blue]
                  > Irmen de Jong wrote:[color=green]
                  > > Randall Smith wrote:
                  > >[color=darkred]
                  > >> 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?[/color]
                  > >
                  > >
                  > > 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.[/color]
                  >
                  > <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>[/color]

                  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 :
                  [color=blue][color=green][color=darkred]
                  >>> from jpype import *
                  >>> startJVM(r"C:\j 2sdk1.4.2_03\jr e\bin\client\jv m.dll", "-ea")
                  >>> 1+1[/color][/color][/color]
                  File "<stdin>", line 1
                  1+1
                  ^
                  SyntaxError: invalid syntax[color=blue][color=green][color=darkred]
                  >>> help()[/color][/color][/color]
                  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

                  Comment

                  • Steve M?nard

                    #10
                    Re: jython 2 cpython bridge

                    nicolas@lehuen. com (Nicolas Lehuen) wrote in message
                    <<snip>>[color=blue][color=green]
                    > >
                    > > <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>[/color]
                    >
                    > 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 :
                    >[color=green][color=darkred]
                    > >>> from jpype import *
                    > >>> startJVM(r"C:\j 2sdk1.4.2_03\jr e\bin\client\jv m.dll", "-ea")
                    > >>> 1+1[/color][/color]
                    > File "<stdin>", line 1
                    > 1+1
                    > ^
                    > SyntaxError: invalid syntax[color=green][color=darkred]
                    > >>> help()[/color][/color]
                    > 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[/color]

                    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

                    Comment

                    • John Mudd

                      #11
                      Re: jython 2 cpython bridge

                      How about Spiro?





                      Randall Smith <randall@tnr.cc > wrote in message news:<8dssc.179 150$f_5.163363@ lakeread01>...[color=blue]
                      > 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[/color]

                      Comment

                      Working...