5

as stated,

does java jdbc driver for postgresql has client side \copy?

I wanted to do batch inserts into a table in the database on a remote machine with data from my text file on another machine.

goh
  • 24,793
  • 28
  • 82
  • 149
  • @Harry, I need to do inserts into the database but the file is only my client machine... – goh Apr 20 '11 at 06:34
  • you mean file is only on client machine. Which file? database backup file? – Harry Joy Apr 20 '11 at 06:36
  • I wanted to do batch inserts into a table in the database on a remote machine with data from my text file on another machine. – goh Apr 20 '11 at 06:42
  • what you can do is: 1) Configure postgres for remote machine. 2) read file from client machine. 3)Execute queries listed on file. – Harry Joy Apr 20 '11 at 06:51

2 Answers2

9

Since the 8.4 driver there is support for the COPY command, through the CopyManager:

http://jdbc.postgresql.org/documentation/publicapi/org/postgresql/copy/CopyManager.html

a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843
0

add ip of your system from where you used to update database in pg_hba.conf file connect usinyg url

jdbc:postgresql://host:port/database

execute query

Nirmal- thInk beYond
  • 11,345
  • 8
  • 34
  • 45