Change connection object to local. Close each connection after executing
a query.