def empall(self):
all = []
try:
conn = getConnection()
cursor = conn.cursor()
try:
cursor.execute("select * from emp01")
rows = cursor.fetchall()
objects_list = []
for row in rows:
d = collections.OrderedDict()
d['empno'] = row[0]
d['ename'] = row[1]
d['sal'] = row[2]
objects_list.append(d)
all = json.dumps(objects_list)
except Exception as e:
print(e)
except Exception as e:
print(e)
finally:
cursor.close()
conn.close()
return all
Object of type 'Decimal' is not JSON serializable