Changeset 2783 for TOOLS/ConsoGENCI/trunk/bin/libconso_db.py
- Timestamp:
- 03/21/16 15:55:15 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/ConsoGENCI/trunk/bin/libconso_db.py
r2775 r2783 29 29 30 30 ####################################################################### 31 def connect_db(db_host, db_name, db_user ):31 def connect_db(db_host, db_name, db_user, db_pwd): 32 32 33 conn_string = "host={} dbname={} user={} ".format(34 db_host, db_name, db_user 33 conn_string = "host={} dbname={} user={} password={}".format( 34 db_host, db_name, db_user, db_pwd 35 35 ) 36 36 … … 44 44 except Exception as rc: 45 45 print("Problem with DB connect:\n{}".format(rc)) 46 exit( 1)46 exit(9) 47 47 48 48 # conn.cursor will return a cursor object, you can use this cursor … … 63 63 except Exception as rc: 64 64 print("Problem with select:\n{}".format(rc)) 65 exit( 1)65 exit(9) 66 66 67 67 # # retrieve the records from the database … … 85 85 except Exception as rc: 86 86 print("Problem with insert:\n{}".format(rc)) 87 exit( 1)87 exit(9) 88 88 89 89 … … 98 98 except Exception as rc: 99 99 print("Problem with commit:\n{}".format(rc)) 100 exit( 1)100 exit(9) 101 101 102 102 … … 110 110 except Exception as rc: 111 111 print("Problem with close:\n{}".format(rc)) 112 exit( 1)112 exit(9) 113 113 114 114
Note: See TracChangeset
for help on using the changeset viewer.