Wednesday, April 11, 2012

executing csv copy command from remote machine with jdbc

How to create stdin object to pass as a parameter to copy command for csv upload into db table and execute with jdbc api



Example that i tried



DataInputStream in = new DataInputStream(new BufferedInputStream(
new FileInputStream("C:/Documents and Settings/517037/Desktop/new.csv")));

copy temp123 from "+in.read()+" using delimiters '|'


But here i am getting error.



org.postgresql.util.PSQLException: ERROR: syntax error at or near "48"
Position: 19



can any one help me out in this





No comments:

Post a Comment