Try to insert packet into database
This commit is contained in:
parent
f543598d9f
commit
ff3501e572
1 changed files with 3 additions and 0 deletions
|
@ -37,6 +37,9 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
|
||||||
def insert_xml(self, data):
|
def insert_xml(self, data):
|
||||||
try:
|
try:
|
||||||
conn = psycopg2.connect("dbname=hackzurich")
|
conn = psycopg2.connect("dbname=hackzurich")
|
||||||
|
cursor = conn.cursor()
|
||||||
|
cursor.execute("insert into data_test4 (packet) values ('%s')" % data)
|
||||||
|
conn.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("DB Insert failed: %s" % e)
|
print("DB Insert failed: %s" % e)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue