Postgresql - COPY TO - get number row inserted - from JDBC

From: Nicolas Paris <niparisco(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Postgresql - COPY TO - get number row inserted - from JDBC
Date: 2015-02-07 14:14:11
Message-ID: CA+ssMOSLA8Sf32CicK2H62hO4ZoBskqEyhx4jmjD9g9rYmq4sw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello !

My goal is to get the result from "COPY TO ..." query, from JDBC. This
query returns : COPY X
(where X is number line inserted)
1) Can I can I consider it useless, since when no error, all lines are
suposed to be inserted ?
2) If not useless, how can I get the response "COPY 10" (when 10 rows
inserted), I get with psql way, or with pgadmin.

I have tried the int Statement.executeUpdate() method, but it returns 0

Thanks for any help !

Nicolas PARIS

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-02-07 15:20:33 Re: Postgresql - COPY TO - get number row inserted - from JDBC
Previous Message Alexey Slynko 2015-02-07 07:47:03 PgConf Russia event