Subject | Re: [Firebird-Java] Disconnect gracefully in Java console app |
---|---|
Author | Thomas Steinmaurer |
Post date | 2008-01-18T13:35:53Z |
Hello Roman,
Regards,
Thomas
>> What's the easiest way to disconnect a database connection when I stopA nice and clean way. Thanks for the pointer!!!
>> my Java application? Some kind of callback?
>
> You can register your shutdown hook in JVM. It is an initialized, but
> not yet started thread that has to perform the cleanup task. For
> example, it can set some flag which will be checked by the thread that
> runs the main loop and will wait until the thread completes.
>
> See documentation to java.lang.Runtime.addShutdownHook(Thread) method.
Regards,
Thomas