What is the best way to manage a database connection in a Java servlet?
Currently, I simply open a connection in the init() function, and then close it
init()
You should only hold a database connection open for as long as you need it, which dependent on what you're doing is probably within the scope of your doGet/doPost methods.
doGet/doPost