Fwd: [Jython-users] Importing Java Source Code to Jython
by Gwyn Evans other posts by this author
Nov 23 2004 10:33AM messages near this date
[Jython-users] Re: Epydoc: kludge-ability for Jython
|
[Jython-users] Importing Java Source Code to Jython
Sent original direct rather than to list!
---------- Forwarded message ----------
From: Gwyn Evans <gwyn.evans@[...].com>
Date: Tue, 23 Nov 2004 10:32:43 +0000
Subject: Re: [Jython-users] Importing Java Source Code to Jython
To: Red Crow <le_mowi@[...].mx>
On Tue, 23 Nov 2004 02:03:18 -0600 (CST), Red Crow <le_mowi@[...].mx> wrote:
> If I change the .java to a .py, the file is
> imported as a python code and I've an error.
>
> I'm think compile the archive .java in a .class
> file, but to me is a bad idea for this moment.
Jython's not a Java interpreter, so you can't directly execute Java
code. You can write Jython, using Java classes, but you need to use
Jython syntax to do so.
e.g. I recently needed to write 'Java' in Jython, as the 'built-in'
zxJDBC seems to have an issue with calling Oracle stored procedures.
As a result, I did the following:-
driver = Class.forName(oracleDriver)
self.conn = sql.DriverManager.getConnection(oracleUrl,
oracleUser, oraclePass)
storedProcedure = "{ CALL XXXX(?, ?, ?, ?) }"
self.callableStatement = self.conn.prepareCall(storedProcedure)
It's very Java-like, but it's Jython, not Java.
/Gwyn
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Jython-users mailing list
Jython-users@[...].net
https://lists.sourceforge.net/lists/listinfo/jython-users
|