File: CopyIn.java

package info (click to toggle)
libpgjava 8.4-701-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,532 kB
  • ctags: 4,162
  • sloc: java: 33,948; xml: 3,158; makefile: 14; sh: 10
file content (43 lines) | stat: -rw-r--r-- 1,566 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*-------------------------------------------------------------------------
*
* Copyright (c) 2009, PostgreSQL Global Development Group
*
* IDENTIFICATION
*   $PostgreSQL: pgjdbc/org/postgresql/copy/CopyIn.java,v 1.1 2009/07/01 05:00:39 jurka Exp $
*
*-------------------------------------------------------------------------
*/
package org.postgresql.copy;

import java.sql.SQLException;

/**
 * Copy bulk data from client into a PostgreSQL table very fast.
 */
public interface CopyIn extends CopyOperation {

    /**
     * Writes specified part of given byte array to an open and writable copy operation.
     * @param buf array of bytes to write
     * @param off offset of first byte to write (normally zero)
     * @param siz number of bytes to write (normally buf.length)
     * @throws SQLException if the operation fails
     */
    void writeToCopy(byte[] buf, int off, int siz) throws SQLException;

    /**
     * Force any buffered output to be sent over the network to the
     * backend.  In general this is a useless operation as it will get
     * pushed over in due time or when endCopy is called.  Some specific
     * modified server versions (Truviso) want this data sooner.
     * If you are unsure if you need to use this method, don't.
     */
    void flushCopy() throws SQLException;
    
    /**
     * Finishes copy operation succesfully.
     * @return number of updated rows for server 8.2 or newer (see getHandledRowCount())
     * @throws SQLException if the operation fails.
     */
    public long endCopy() throws SQLException;
}