Python Connector for Oracle

Connecting to for Oracle - Python Connector for Oracle

Connecting to Oracle

To establish a connection to an Oracle database, import the connector and use the connect() method with your connection parameters.

Step 1. Import the connector

First, import the Oracle connector module:

import devart.oracle as oracle

Step 2. Establish a connection

Call the connect() method and obtain a connection object.

my_connection = oracle.connect(
    Direct=True,
Host="your_server",
ServiceName="your_service_name",
UserName="your_username",
Password="your_password" )

Replace the example values with your actual connection values.

For more information, see Connection parameters.

© 2022-2026 Devart. All Rights Reserved. Request Support Python Connectors Forum Provide Feedback