What happens if connection is not closed in a jdbc program?

if we don't close the connection , it wil lead to connection memory leakage.unless until application server/web server is shut down ,connection wil remain activate even though the user logs out .