get_connection()
This page is part of MariaDB's Enterprise Documentation.
The parent of this page is: Connector/Python API
Topics on this page:
Overview
Returns a connection from the connection pool or raises a PoolError exception if a connection is not available.
See also: MariaDB Connector/Python 1.1 and in 1.0
EXAMPLES
import mariadb
pool = mariadb.ConnectionPool(
pool_name = 'pool1',
pool_size = 3,
pool_reset_connection = False,
host = '127.0.0.1',
user = 'root',
password = 'secret',
database = 'test',
)
conn = pool.get_connection()
cursor = conn.cursor()
CHANGE HISTORY
Release Series | History |
---|---|
1.1 |
|
1.0 |
|