Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import sys
  2. load("C:postgresql-42.1.3.jre6.jar")
  3. from com.ziclix.python.sql import zxJDBC
  4. url = "jdbc:postgresql://localhost:5432/postgres"
  5. dbuser = "postgres"
  6. dbpassword = "postgres"
  7. driver = "org.postgresql.Driver"
  8. dbconn=zxJDBC.connect(url, dbuser, dbpassword, driver)
  9. dbcur = dbconn.cursor()
  10.  
  11. dbcur.execute("delete from test")
  12. dbcur.execute("\COPY test FROM 'C:\test_data.csv' stdin DELIMITER ',' CSV header;")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement