Updated on 2024-06-03 GMT+08:00

CopyManager

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

Inheritance Relationship of CopyManager

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

public class CopyManager
extends Object

Constructor Method

public CopyManager(BaseConnection connection)

throws SQLException

Common Methods

Table 1 Common methods of CopyManager

Return Value

Method

Description

throws

Support JDBC4 (Yes/No)

CopyIn

copyIn(String sql)

-

SQLException

Yes

long

copyIn(String sql, InputStream from)

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

SQLException,IOException

Yes

long

copyIn(String sql, InputStream from, int bufferSize)

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

SQLException,IOException

Yes

long

copyIn(String sql, Reader from)

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

SQLException,IOException

Yes

long

copyIn(String sql, Reader from, int bufferSize)

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

SQLException,IOException

Yes

CopyOut

copyOut(String sql)

-

SQLException

Yes

long

copyOut(String sql, OutputStream to)

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

SQLException,IOException

Yes

long

copyOut(String sql, Writer to)

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

SQLException,IOException

Yes