Advertisement
Guest User

Untitled

a guest
Mar 9th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. try:
  2. conn = psycopg2.connect("dbname='test1' user='postgres' host='localhost' password='123'")
  3. cur = conn.cursor()
  4. cur.execute("""INSERT INTO product_info (product_name) VALUES (%s)""", 'xxx')
  5. except:
  6. print "error happens"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement