Python connect Oracle Database

Hi everyone, today i will show you how to connect Oracle database using python.

Python is very popular and easy to learn programing language. We may need to connect to the database when programming with python. Let’s think simple, just you need import Oracle db package .

import cx_Oracle

Thats all. If you can’t import you need to dowload first. Open ide terminal and

pip install cx_Oracle

Create python file (.py) and add this rows,

conn = cx_Oracle.connect('world/oracle@192.168.43.73/TESTDB')
cursor=conn.cursor()
print (conn.version)

A small code to check that we are connected to the database

 

Thats all, good luck and see you next article.

 

 

Do you want to learn Oracle Database for Beginners, then read the following articles.

https://ittutorial.org/oracle-database-19c-tutorials-for-beginners/

 300 views last month,  8 views today

About Deniz Parlak

blank
Hi, i’m Security Data Scientist & Data Engineer at My Security Analytics. I have experienced Advance Python, Machine Learning and Big Data tools. Also i worked Oracle Database Administration, Migration and upgrade projects. For your questions parlak.deniss@gmail.com

Check Also

blank

Alter System Flush Shared pool in Oracle

Hi, I will explain Alter System Flush Shared pool in Oracle in this post.  4,900 views …

Leave a Reply