Suppose I have the following code
DataSource source = (DataSource) (new InitialContext()).lookup("jdbc/myName");
Connection connnection = source.getConnection()
//use the connection to do some database operations...
at the end, should I still call
connection.close()
to release the resource?
If the connection is from a connection pool, if I don't do anything, the connection should be automatically returned to the pool, right?
On the other hand, if I close it, is there gonna be any adverse effect on the connection pool (ie, after several calls, there won't be any connection left in the pool?)