This week's giveaway is in the Java/Jakarta EE forum. We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line! See the init() and destroy() methods of a servlet.
You could do it for allocating resources like database Connections.
However it won't be a good idea to write a database connection in a servlet as it could result in performance criteria.