This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
its good practice to seperate all possible cases in seperate catch block(try to cover all types of exception don't use Exception class). and instead of using printStatckTrace()
use Logger class to print your exception in console.
and don't forget to use finally for query to close your connection, resultset, statement objects.