Updated on 2025-07-22 GMT+08:00

CopyManager

CopyManager is an API class provided by the JDBC driver in GaussDB. It is used to import data to GaussDB in batches.

Inheritance Relationship of CopyManager

The CopyManager class is in the com.huawei.opengauss.jdbc.copy package and inherits the java.lang.Object class. The declaration of the class is as follows:

public class CopyManager
extends Object

Construction Method

public CopyManager(BaseConnection connection)

throws SQLException

Common Methods

Table 1 Common methods of CopyManager

Method

Return Type

Description

throws

copyIn(String sql)

CopyIn

-

SQLException

copyIn(String sql, InputStream from)

long

Uses COPY FROM STDIN to quickly load data to tables in the database from InputStream.

SQLException,IOException

copyIn(String sql, InputStream from, int bufferSize)

long

Uses COPY FROM STDIN to quickly load data of a specified length to tables in the database from InputStream.

SQLException,IOException

copyIn(String sql, Reader from)

long

Uses COPY FROM STDIN to quickly load data to tables in the database from Reader.

SQLException,IOException

copyIn(String sql, Reader from, int bufferSize)

long

Uses COPY FROM STDIN to quickly load data of a specified length to tables in the database from Reader.

SQLException,IOException

copyOut(String sql)

CopyOut

-

SQLException

copyOut(String sql, OutputStream to)

long

Sends the result set of COPY TO STDOUT from the database to the OutputStream class.

SQLException,IOException

copyOut(String sql, Writer to)

long

Sends the result set of COPY TO STDOUT from the database to the Writer class.

SQLException,IOException