set_connection¶
In [ ]:
set_connection(conn)
Saves a custom connection to the VerticaPy object. This allows you to specify, for example, a JDBC or ODBC connection. This should not be confused with a native VerticaPy connection created by the new_connection function.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
conn | object | ❌ | Connection object. |
Example¶
In [25]:
# Creating a connection
import vertica_python
conn_info = {'host': "10.211.55.14",
'port': 5433,
'user': "dbadmin",
'password': "XxX",
'database': "testdb"}
conn = vertica_python.connect(** conn_info)
# Setting the connection
from verticapy.connect import set_connection
set_connection(conn)