diff --git a/core/bll/__pycache__/bllengine.cpython-38.pyc b/core/bll/__pycache__/bllengine.cpython-38.pyc index 73fc6a9..a019f5d 100644 Binary files a/core/bll/__pycache__/bllengine.cpython-38.pyc and b/core/bll/__pycache__/bllengine.cpython-38.pyc differ diff --git a/core/bll/bllengine.py b/core/bll/bllengine.py index d2804c6..560d126 100644 --- a/core/bll/bllengine.py +++ b/core/bll/bllengine.py @@ -234,7 +234,7 @@ def dbacl_processupdateonecond(reqData): dbaclId = data['dbaclId'] status = data['status'] updateStatement = "dbaclname = '{}',dbuserid = '{}',dbaclid = '{}',status = '{}'".format(dbaclName,dbuserId,dbaclId,status) - condition = "dbaclId = '{}'".format(dbaclId) + condition = "dbaclid = '{}'".format(dbaclId) sta = dbilayer.updateValuesIndb('dbACL', updateStatement, condition) print(sta) if(sta == "Success"): diff --git a/core/dbil/__pycache__/dbilayer.cpython-38.pyc b/core/dbil/__pycache__/dbilayer.cpython-38.pyc index d0431f6..94bd4d4 100644 Binary files a/core/dbil/__pycache__/dbilayer.cpython-38.pyc and b/core/dbil/__pycache__/dbilayer.cpython-38.pyc differ diff --git a/core/dbil/dbilayer.py b/core/dbil/dbilayer.py index 0e031ba..8163b47 100644 --- a/core/dbil/dbilayer.py +++ b/core/dbil/dbilayer.py @@ -15,9 +15,6 @@ import cx_Oracle db_connection = cx_Oracle.connect("ganesh/ganeshm0477@//localhost:1521/xe") - - - # db_connection = mysql.connector.connect( # host="localhost", # user="root", @@ -82,6 +79,7 @@ def getUserActivity(tablename, fields, userData): output=my_database.fetchone() except: output={"Error":"No data recieved or error occured"} + print("Error: " + str(e)) # db_connection.close() print(output) return output @@ -97,8 +95,9 @@ def readallWithoutCondition(tablename, fields): results = [dict(zip(columns, row)) for row in rows] retval = "Success" return results - except : - retval = "Failure" + except Exception as e: + retval = "Failed" + print("Error: " + str(e)) return retval def readallWithCondition(tablename, fields, condition): @@ -112,8 +111,9 @@ def readallWithCondition(tablename, fields, condition): results = [dict(zip(columns, row)) for row in rows] retval = "Success" return results - except : - retval = "Failure" + except Exception as e: + retval = "Failed" + print("Error: " + str(e)) return retval def readOneWithcondition(tablename, fields, cond): @@ -127,39 +127,43 @@ def readOneWithcondition(tablename, fields, cond): results = [dict(zip(columns, row)) for row in rows] print(rows) return results - except : - retval = "Failure" + except Exception as e: + retval = "Failed" + print("Error: " + str(e)) return retval def insertIntoDBWithoutCondition(tablename,fields,data): my_database=db_connection.cursor() sql_query="INSERT INTO {} ({}) VALUES({})".format(tablename, fields, data) print(sql_query) - # try: - my_database.execute(sql_query) - db_connection.commit() - retval = "Success" - return retval - # except: - # retval = "Failure" - # return retval + try: + my_database.execute(sql_query) + db_connection.commit() + retval = "Success" + return retval + except Exception as e: + retval = "Failed" + print("Error: " + str(e)) + return retval def updateValuesIndb(tablename,updatestatement,condition): my_database = db_connection.cursor() sql_statement = "UPDATE " + tablename + " SET " + updatestatement + " WHERE " + condition + "" print(sql_statement) - # try: - my_database.execute(sql_statement) - db_connection.commit() - retval = "Success" - return retval - # except: - # retval = "Failure" - # return retval + try: + my_database.execute(sql_statement) + db_connection.commit() + retval = "Success" + return retval + except Exception as e: + retval = "Failed" + print("Error: " + str(e)) + return retval def updateDataWithCondition(tablename,updateStatement,condition): pass +