doc-exports/docs/dws/dev/dws_04_0205.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

106 lines
10 KiB
HTML

<a name="EN-US_TOPIC_0000001233681825"></a><a name="EN-US_TOPIC_0000001233681825"></a>
<h1 class="topictitle1">Introduction to the CopyManager Class</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001233681825__ac59159d3832448bfad3bd8768e5eebae">CopyManager is an API interface class provided by the JDBC driver in <span id="EN-US_TOPIC_0000001233681825__text2028780758">GaussDB(DWS)</span>. It is used to import data to <span id="EN-US_TOPIC_0000001233681825__text884692567">GaussDB(DWS)</span> in batches.</p>
<div class="section" id="EN-US_TOPIC_0000001233681825__sa4bc3f3abcfc45a3877a1378f77bb3f2"><h4 class="sectiontitle">Inheritance Relationship of CopyManager</h4><p id="EN-US_TOPIC_0000001233681825__ab098e00fd64e40f481104e0194cf102e">The CopyManager class is in the <strong id="EN-US_TOPIC_0000001233681825__b842352706193825">org.postgresql.copy</strong> package class and is inherited from the java.lang.Object class. The declaration of the class is as follows:</p>
<pre class="screen" id="EN-US_TOPIC_0000001233681825__sfdd38abdd5104ffdb270f68e0fcf84dd">public class CopyManager
extends Object</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001233681825__sd5c24421a0dd4d328b78651d88948e05"><h4 class="sectiontitle">Constructor Method</h4><p id="EN-US_TOPIC_0000001233681825__a688703e770c44439872e36cf5c9baee8">public CopyManager(BaseConnection connection)</p>
<p id="EN-US_TOPIC_0000001233681825__ae6be88198a7546479bafc7466912e1f2">throws SQLException</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001233681825__s4400fc6b3aae4f509309ab311ebbb6da"><h4 class="sectiontitle">Basic Methods</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233681825__t991eaf47a77048c8b0f61d613a79e1a9" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Basic methods of CopyManager</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233681825__rf70de13c9218405ea5a2e50985d31472"><th align="left" class="cellrowborder" valign="top" width="12.78%" id="mcps1.3.4.2.2.5.1.1"><p id="EN-US_TOPIC_0000001233681825__a7ed5e8bbe32446a08150b93264807467">Return Value</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="37.22%" id="mcps1.3.4.2.2.5.1.2"><p id="EN-US_TOPIC_0000001233681825__a153d14eaec8d47d790f266538533f249">Method</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.2.5.1.3"><p id="EN-US_TOPIC_0000001233681825__a74d92066d4734d0ab3f99f0401567cd2">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.2.5.1.4"><p id="EN-US_TOPIC_0000001233681825__a3685b500684c4a5eb1c340323a3205fc">Throws</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001233681825__rfbfdaa9e5d3947a98c6446549683f9d5"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681825__ab7c3c9a2c45947eb8928588337ac1cb7">CopyIn</p>
</td>
<td class="cellrowborder" valign="top" width="37.22%" headers="mcps1.3.4.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681825__a54cea5fb26c04378ad2ec169cee2ac81">copyIn(String sql)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681825__abb9174b0a4ad43648c8e5a731758fbc1">-</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681825__a95ba0d6e2f5c436db165f467cdbf1b4c">SQLException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681825__r9c6abae694c741deb9350da068f231cd"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681825__ae37bb8a22ee04df1bee33a9d39caf758">long</p>
</td>
<td class="cellrowborder" valign="top" width="37.22%" headers="mcps1.3.4.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681825__a6a490be2055342f3b4a73432d84d0ba4">copyIn(String sql, InputStream from)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681825__a6d11590c20a34dab84506bc676ed26b0">Uses <strong id="EN-US_TOPIC_0000001233681825__b842352706193948_1">COPY FROM STDIN</strong> to quickly import data to tables in a database from InputStream.</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681825__af0357ed0290448be96c87ff0583dafa1">SQLException,IOException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681825__r6155bd97e9cc48689077eb219e00e0ef"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681825__a7d0c68bb864342f4bdcc839217ab7cbe">long</p>
</td>
<td class="cellrowborder" valign="top" width="37.22%" headers="mcps1.3.4.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681825__a2325b7ed77084f76aa73dfff0550461d">copyIn(String sql, InputStream from, int bufferSize)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681825__af6744262614c43e7af2d337a3c0a5758">Uses <strong id="EN-US_TOPIC_0000001233681825__b593751171411">COPY FROM STDIN</strong> to quickly import data to tables in a database from InputStream.</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681825__ab062b71ef62e4cc79ac1fab4dd36a611">SQLException,IOException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681825__ra6b1a40651ff4968b4c31275fc066aae"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681825__ab7a032a677a740e8a32d6954823b46c5">long</p>
</td>
<td class="cellrowborder" valign="top" width="37.22%" headers="mcps1.3.4.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681825__aaf9dbaeaf0e143d88a0524acb1a70a8b">copyIn(String sql, Reader from)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681825__aa09ecbc70847402ab97003b6a8398d20">Uses <strong id="EN-US_TOPIC_0000001233681825__b842352706193948_5">COPY FROM STDIN</strong> to quickly import data to tables in a database from Reader.</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681825__a1fef5a59c315461488bd7f37b283315c">SQLException,IOException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681825__r091272b27cdf419784d3c5f315651809"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681825__a0c5bbfe5e56f43bda6d642cc2b479a73">long</p>
</td>
<td class="cellrowborder" valign="top" width="37.22%" headers="mcps1.3.4.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681825__ac9ef92d3ffae42bb84ae93c142ae7301">copyIn(String sql, Reader from, int bufferSize)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681825__a762ac9572b6e430fb90ee13a259aa90f">Uses <strong id="EN-US_TOPIC_0000001233681825__b436015314148">COPY FROM STDIN</strong> to quickly import data to tables in a database from Reader.</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681825__a98879e7c491d41dc803a0c08b95a290e">SQLException,IOException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681825__rda2cc4ae9d8d43ac80ac365e472a7b8c"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681825__aa230d35b9f4c407cb726d42e4a20de3a">CopyOut</p>
</td>
<td class="cellrowborder" valign="top" width="37.22%" headers="mcps1.3.4.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681825__a067c8c430ffb43a995e7248db0ab0301">copyOut(String sql)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681825__a2ada4f8aab5c47b69a63de3273743af8">-</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681825__acd09070900a747719f2a505c14b8b425">SQLException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681825__r68f72fbab6bd4045bb555d7c4e1585bc"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681825__ae9b7f6b003014582a1ad6b5646233da7">long</p>
</td>
<td class="cellrowborder" valign="top" width="37.22%" headers="mcps1.3.4.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681825__a756cb1a354c14a92a7caceecc5183c4c">copyOut(String sql, OutputStream to)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681825__ae43078dfe13c40c19519d8a30b3b3fa3">Sends the result set of <strong id="EN-US_TOPIC_0000001233681825__b842352706194036">COPY TO STDOUT</strong> from a database to the OutputStream class.</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681825__aa741b9130c5d453b992558b2549d4842">SQLException,IOException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233681825__r51eb1352a86e42af9a8776c3f4ddcf4f"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001233681825__a502cccc2ad9a4545b3af00053a70e025">long</p>
</td>
<td class="cellrowborder" valign="top" width="37.22%" headers="mcps1.3.4.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001233681825__aa07a235020d74112a1bef14ea7ca371d">copyOut(String sql, Writer to)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001233681825__ad6df8cc9eb1349bf8c326d2ccd167f18">Sends the result set of <strong id="EN-US_TOPIC_0000001233681825__b831028473">COPY TO STDOUT</strong> from a database to the Writer class.</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001233681825__a12fc4c1944044f8883afb3bbfb4c4776">SQLException,IOException</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0203.html">Running the COPY FROM STDIN Statement to Import Data</a></div>
</div>
</div>