User Profile

Collapse

Profile Sidebar

Collapse
Jindra
Jindra
Last Activity: Apr 18 '12, 10:46 AM
Joined: Apr 2 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Jindra
    replied to cleanup actions on sys.exit()
    Oh, yes, this is what I was looking for but could not find! :) Thank you, dwblas!
    Strangely, I haven't heard of __del__ since I first learn some python (version 1.6, I guess).
    In the meantime, I found there is one more way in Swing, and that is Runtime.addShut downHook(Thread ).
    I defined this function:
    Code:
    class ShutdownTask( java.lang.Thread ):
        def __init__( self, connection ):
            self.conn = connection
    ...
    See more | Go to post

    Leave a comment:


  • Jindra
    started a topic cleanup actions on sys.exit()

    cleanup actions on sys.exit()

    Hello,
    I wrote a GUI app in Jython (using Java Swing) which uses database. The application remains connected for its whole run time until the main window is closed (JFrame, using defaultCloseOpe ration = JFrame.EXIT_ON_ CLOSE).
    Now, when exiting, I would like to make sure I explicitly close the database connection. Is there any function, like _atexit() in C, where I could place my code?
    Thank you very much.
    See more | Go to post

  • Jindra
    replied to Jython: cannot import Java packages
    Hello,
    finally resolved. It is not an import problem (driver imports OK, when instantiated, call to main() prints driver info).

    The real problem is non-functional java.sql.Driver Manager in Jython

    java.sql.Driver Manager.getConn ection() will always report "no suitable driver found" or similar, depending if it is Java 5 or Java 6.

    The solution is very simple: since I have the OracleDriver class...
    See more | Go to post
    Last edited by Jindra; Apr 3 '12, 09:16 AM. Reason: precise expression

    Leave a comment:


  • Jindra
    started a topic Jython: cannot import Java packages

    Jython: cannot import Java packages

    Hello,
    I developed some useful Jython script in Eclipse, using ojdbc6.jar as driver library (attached to the project as "external library"). When debugging in Eclipse, everything goes fine. Also standalone run on the development PC runs OK.

    Then I copied the complete Jython 2.5.2 installation to another machine (with Java JRE 1.6.30), copied my script and the ojdbc6.jar library in the same directory as the script....
    See more | Go to post
No activity results to display
Show More
Working...