Closing Database Connections in Java

前端 未结 6 1368
小鲜肉
小鲜肉 2020-11-22 09:34

I am getting a little confused, I was reading the below from http://en.wikipedia.org/wiki/Java_Database_Connectivity

Connection conn = DriverManager.getConn         


        
6条回答
  •  甜味超标
    2020-11-22 10:13

    Yes, you need to close the Connection. Otherwise, the database client will typically keep the socket connection and other resources open.

提交回复
热议问题