Added finally to close jdbc connections