It is better to use a JNDI lookup and DataSource to obtain your
JDBC Connection, but this isn't the cause of your problem.
Ensure that your Connection variable is
local, that you obtain your Connection as late as possible and that you close your ResultSet, Statement and Connection when they are not needed. I recommend closing these JDBC objects in the finally block of the method in which they were created, but don't throw exceptions in this block. Check that you are using the correct driver. If you still have a problem, please post your full code.