Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- load("C:postgresql-42.1.3.jre6.jar")
- from com.ziclix.python.sql import zxJDBC
- url = "jdbc:postgresql://localhost:5432/postgres"
- dbuser = "postgres"
- dbpassword = "postgres"
- driver = "org.postgresql.Driver"
- dbconn=zxJDBC.connect(url, dbuser, dbpassword, driver)
- dbcur = dbconn.cursor()
- dbcur.execute("delete from test")
- dbcur.execute("\COPY test FROM 'C:\test_data.csv' stdin DELIMITER ',' CSV header;")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement