File: CopyOperation.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 (55 lines) | stat: -rw-r--r-- 1,564 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
44
45
46
47
48
49
50
51
52
53
54
55
/*-------------------------------------------------------------------------
*
* Copyright (c) 2009, PostgreSQL Global Development Group
*
* IDENTIFICATION
*   $PostgreSQL: pgjdbc/org/postgresql/copy/CopyOperation.java,v 1.1 2009/07/01 05:00:39 jurka Exp $
*
*-------------------------------------------------------------------------
*/
package org.postgresql.copy;

import java.sql.SQLException;

/**
 * Exchange bulk data between client and PostgreSQL database tables.
 * See CopyIn and CopyOut for full interfaces for corresponding copy directions.
 */
public interface CopyOperation {

    /**
     * @return number of fields in each row for this operation
     */
    int getFieldCount();

    /**
     * @return overall format of each row: 0 = textual, 1 = binary
     */
    int getFormat();

    /**
     * @param field number of field (0..fieldCount()-1)
     * @return format of requested field: 0 = textual, 1 = binary
     */
    int getFieldFormat(int field);
    
    /**
     * @return is connection reserved for this Copy operation?
     */
    boolean isActive();
    
    /**
     * Cancels this copy operation, discarding any exchanged data.
     * @throws SQLException if cancelling fails
     */
    void cancelCopy() throws SQLException;

    /**
     * After succesful end of copy, returns the number
     * of database records handled in that operation.
     * Only implemented in PostgreSQL server version 8.2 and up.
     * Otherwise, returns -1.
     * @return number of handled rows or -1
     */
    public long getHandledRowCount();
}