ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> Jython-users
Jython-users
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved