if self.conn is None:
if DBTYPE == 'mysql':
import MySQLdb
- self.conn = MySQLdb.connect(host=DBHOST, port=DBPORT, user=DBUID, password=DBPWD, database=DBNAME)
+ self.conn = MySQLdb.connect(host=DBHOST, port=DBPORT, user=DBUID, passwd=DBPWD, db=DBNAME)
elif DBTYPE == 'postgresql':
import psycopg2
self.conn = psycopg2.connect(host=DBHOST, port=DBPORT, user=DBUID, password=DBPWD, dbname=DBNAME)
cursor.execute(sqlite_sql)
cursor.execute('commit')
except DBError as e:
- print (e)
if DBTYPE != 'sqlite':
conn.rollback()
else: