Documentation Home
Connectors and APIs Manual
Download this Manual
PDF (US Ltr) - 4.1Mb
PDF (A4) - 4.1Mb


6.9.3.2 MySQLConnectionPool.add_connection() Method

Syntax:

cnxpool.add_connection(cnx = None)

This method adds a new or existing MySQLConnection to the pool, or raises a PoolError if the pool is full.

Arguments:

  • cnx: The MySQLConnection object to be added to the pool. If this argument is missing, the pool creates a new connection and adds it.

Example:

cnxpool.add_connection()    # add new connection to pool
cnxpool.add_connection(cnx) # add existing connection to pool