openGauss Introduction to the CopyManager Class

·

2 min read

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

Inheritance Relationship of CopyManager

The CopyManager class is in the org.opengauss.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

Return ValueMethodDescriptionthrows
CopyIncopyIn(String sql)-SQLException
longcopyIn(String sql, InputStream from)Uses COPY FROM STDIN to quickly import data to tables in a database from InputStream.SQLException,IOException
longcopyIn(String sql, InputStream from, int bufferSize)Uses COPY FROM STDIN to quickly import data to tables in a database from InputStream.SQLException,IOException
longcopyIn(String sql, Reader from)Uses COPY FROM STDIN to quickly import data to tables in a database from Reader.SQLException,IOException
longcopyIn(String sql, Reader from, int bufferSize)Uses COPY FROM STDIN to quickly import data to tables in a database from Reader.SQLException,IOException
CopyOutcopyOut(String sql)-SQLException
longcopyOut(String sql, OutputStream to)Sends the result set of COPY TO STDOUT from the database to the OutputStream class.SQLException,IOException
longcopyOut(String sql, Writer to)Sends the result set of COPY TO STDOUT from the database to the Writer class.SQLException,IOException