I try to connect to an Oracle database with Python, but it can't connect.
This is my code:
import cx_Oracle
class CustomDatabase(object):
def getDataFromDatabase(self, connectDB, queryCommand, row):
conn = cx_Oracle.connect(self.connectDB)
cur = conn.cursor()
cur.execute(self.queryCommand)
res = cur.fetchone()
i = 0
while (i < self.row):
if cur.rowcount == self.row:
print res
res = cur.fetchone()
i = i + 1
cur.close()
conn.close()
return res
a = CustomDatabase()
b = a.getDataFromDatabase("'Bell', 'pwd1234#', '191.168.1.10:1111/MyName'","select * from Mybook",5)
Below is the error I get:
Error show "AttributeError: 'CustomDatabase' object has no attribute 'connectDB'
Any advice on this matter?