Skip site navigation (1) Skip section navigation (2)

COPY support implemented

From: Kris Jurka <books(at)ejurka(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: COPY support implemented
Date: 2003-12-30 08:25:00
Message-ID: Pine.LNX.4.33.0312300317040.8223-200000@leary.csoft.net (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-jdbc
With the introduction of the V3 protocol in 7.4 it is now possible to
support the COPY protocol in the JDBC driver.  Before it was impossible to
recover from errors and the Connection had to be abandoned.  This patch
implements support for COPY based on the API proposed by Michael
Adler's original patch of about a year ago.

For example

Connection conn = DriverManager.getConnection(...);
CopyManager copy = ((org.postgresql.PGConnection)conn).getCopyAPI();

// copy data from the table to the given output stream
OutputStream output = new ByteArrayOutputStream();
copy.copyOut("tablename",output);

// copy data from the given input stream to the table
InputStream input = new ByteArrayInputStream(output.toByteArray());
copy.copyIn("tablename",input);

Kris Jurka


Attachment: copy.patch
Description: text/plain (16.4 KB)

Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2003-12-30 10:01:18
Subject: ResultSetMetaData enhancements
Previous:From: John Sidney-WoollettDate: 2003-12-30 07:36:20
Subject: Re: Multi-threaded servlet environment

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group