I would like to connect to multiple databases in oracle

0 votes
How can I connect to multiple database in oracle using python library ?
Feb 16 in Python by Radhika
• 120 points
362 views

1 answer to this question.

0 votes

Hey Radhika,

To communicate any database with Python program, you required a connector which is nothing but the cx_Oracle module.

  • To installing cx_Oracle : 
  1. With this command, you can install the cx_Oracle package, but it is required to install the Oracle database first in your PC..
pip install cx_Oracle
  • Now you need to use some modules for connection:
  1. Import specific database module- import cx_Oracle
  2. Connect()  :- Now establish a connection between the Python program and the Oracle database by using connect() function.​
                  connect = cx_Oracle.connect('username/password@localhost')

       3. Cursor(): To execute SQL query and to provide a result, some special object required is nothing but cursor() object

                  cursor = cx_Oracle.cursor()

For more and clear cut information you can go through this https://datatofish.com/how-to-connect-python-to-an-oracle-database-using-cx_oracle/ I hope this will help.

answered Feb 17 by Gitika
• 33,210 points
Thanks Gitika. How about multiple DB's ? What is the approach to connect to multiple databases which are on multiple servers ?

Thanks,

Radhika.

Related Questions In Python

0 votes
2 answers

How do I connect to a MySQL Database in Python?

connect mysql database with python import MySQLdb db = ...READ MORE

answered Mar 28, 2019 in Python by rajesh
• 1,230 points
472 views
+3 votes
5 answers

How to read multiple data files in python

Firstly we will import pandas to read ...READ MORE

answered Apr 6, 2018 in Python by DeepCoder786
• 1,720 points
8,333 views
0 votes
1 answer

Connect to a MySQL DB in python?

db = MySQLdb.connect(host="localhost", # ...READ MORE

answered Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
100 views
+3 votes
2 answers

how to print array integer without [] bracket in python like result = 1,2,3,4,5

Hey @abhijmr.143, you can print array integers ...READ MORE

answered Aug 4, 2018 in Python by Omkar
• 69,040 points

edited Aug 8, 2018 by Omkar 3,819 views
+7 votes
2 answers

I want to build a recommender system incorporating diversity and accuracy in the recommender engine.

I dont know what exactly you are ...READ MORE

answered Sep 24, 2018 in Python by slayer
• 29,270 points
347 views
0 votes
1 answer

How do I append one string to another in Python?

If you only have one reference to ...READ MORE

answered Oct 22, 2018 in Python by SDeb
• 13,250 points
93 views
0 votes
2 answers

How can I rename multiple files in a certain directory using Python?

import os from optparse import OptionParser, Option class MyOption ...READ MORE

answered Jul 28 in Python by The real slim shady
1,773 views
0 votes
1 answer

Question on PyQt: How to connect a signal to a slot to start a background operation in Python

It shouldn't matter whether the connection is ...READ MORE

answered Nov 27, 2018 in Python by Nymeria
• 3,520 points
481 views
0 votes
1 answer
+1 vote
6 answers