Why should we close the connection?

If you do not close the Statement object, they will always take up server resources until the JAVA garbage collector to reclaim it. As a good programming style, style show should be turned off when they do not need to Statement object, it will immediately release server resources, help avoid potential memory problems. Similarly, the use of the full database connection, you should turn it off, release the database connection resources occupied.

Guess you like

Origin www.cnblogs.com/q2546/p/11464661.html