Useful example of a shutdown hook in Java?

You could do the following: Let the shutdown hook set some AtomicBoolean (or volatile boolean) “keepRunning” to false (Optionally, .interrupt the working threads if they wait for data in some blocking call) Wait for the working threads (executing writeBatch in your case) to finish, by calling the Thread.join() method on the working threads. Terminate the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)