Loading...
Engaged Employer
How to close connections on exception
Anonymous
You can use try with resource, so that it will close the connection if it is success or failure.
You can use finally block to close exceptions generally catch block should be fine but you need to make sure that connection gets closed everytime
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.