Skip to content

A minimal Python project that demonstrates how to connect to an Oracle database using the `python-oracledb` driver.

Notifications You must be signed in to change notification settings

apandis/python-oracledb-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oracle DB Connection Project

A minimal Python project that demonstrates how to connect to an Oracle database using the python-oracledb driver.

Setup

  1. Clone the Repository:

    git clone https://github.com/apandis/python-oracledb-example.git
    cd python-oracledb-exampl
  2. Create and Activate a Virtual Environment:

    python -m venv env
    • On Windows:
      env\Scripts\activate
    • On macOS/Linux:
      source env/bin/activate
  3. Install Dependencies:

    pip install -r requirements.txt
  4. Configure Environment Variables:

    Create a .env file in the project root with the following content:

    DB_USER=your_username
    DB_PASS=your_password
    DB_SERVER=your_server_address
    DB_PORT=1521
    DB_SERVICE=your_service_name

Running the Application

To connect to the Oracle database and execute a sample query, run:

python src/main.py

Running Tests

To run the tests, use:

python -m unittest discover tests

Dependencies

About

A minimal Python project that demonstrates how to connect to an Oracle database using the `python-oracledb` driver.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages