Added a connection pooling function.