|
Java™ by example!
|
|
|
How do I use a shutdown hook?
To gain control over when you application shuts down (eg. to close database connections), you can use the 1.3 method addShutdownHook in the Runtime class and pass it a thread object. The JVM will execute the thread when the application is about the end. eg.
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|