You need to tell
JDBC that you are done using its resources. Examples:
Statement.close()
ResultSet.close()
Connection.close()
Take a look at one of the JDBC tutorials out there. I haven't looked at one in years so cannot recommend a good one. Perhaps someone else can.