Commit data :-)

This commit is contained in:
Nico Schottelius 2016-09-16 18:27:44 +02:00
parent 531e188fc2
commit 0a8d980f73

View file

@ -39,6 +39,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
conn = psycopg2.connect("dbname=hackzurich") conn = psycopg2.connect("dbname=hackzurich")
cursor = conn.cursor() cursor = conn.cursor()
cursor.execute("insert into data (packet) values (%s)", (data, )) cursor.execute("insert into data (packet) values (%s)", (data, ))
cursor.connection.commit()
conn.close() conn.close()
except Exception as e: except Exception as e:
print("DB Insert failed: %s" % e) print("DB Insert failed: %s" % e)