doc-exports/docs/dws/dev/dws_04_0116.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_0000001188642220"></a><a name="EN-US_TOPIC_0000001188642220"></a>
<h1 class="topictitle1">CopyManager</h1>
<div id="body1527239099917"><p id="EN-US_TOPIC_0000001188642220__a63d3bb2dba314445b16c2caf0e4ffd5c">CopyManager is an API interface class provided by the JDBC driver in <span id="EN-US_TOPIC_0000001188642220__text658151934">GaussDB(DWS)</span>. It is used to import data to <span id="EN-US_TOPIC_0000001188642220__text1073477488">GaussDB(DWS)</span> in batches.</p>
<div class="section" id="EN-US_TOPIC_0000001188642220__s13d4e1ae6e7f4093b2befca4f95bcb2a"><h4 class="sectiontitle">Inheritance Relationship of CopyManager</h4><p id="EN-US_TOPIC_0000001188642220__aef5a2034ed6c407cb76224098137bb63">The CopyManager class is in the <strong id="EN-US_TOPIC_0000001188642220__b842352706193825">org.postgresql.copy</strong> package class and inherits the java.lang.Object class. The declaration of the class is as follows:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188642220__s0699eca7ceae41f1b325901a54d7dced">public class CopyManager
extends Object</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642220__s991f7f5cbc1b416486a230ecf182f34c"><h4 class="sectiontitle">Construction Method</h4><p id="EN-US_TOPIC_0000001188642220__aa45532108ede4a508758018a2dd72528">public CopyManager(BaseConnection connection)</p>
<p id="EN-US_TOPIC_0000001188642220__a0bda1be6170849c6992d19f47a059c94">throws SQLException</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642220__scf2f0864aee74d8c9f6306919559bcef"><h4 class="sectiontitle">Basic Methods</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188642220__te5d166cd4a53435aa48ef72d32e0fff5" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Common methods of CopyManager</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188642220__rc928bb23b3184909aed9b751ea9b997e"><th align="left" class="cellrowborder" valign="top" width="12.78%" id="mcps1.3.4.2.2.5.1.1"><p id="EN-US_TOPIC_0000001188642220__a1af2301e1c554678a2d5ee7a05b03d40">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_0000001188642220__a5f1c179d370f43a2981fce85f3fad581">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_0000001188642220__af5f780869bcc45f7b04d4d537f3f8efa">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_0000001188642220__aea5205c9b1d0476983fc32d2eed9a26b">throws</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188642220__r27e5026a07e5421293e081c6f6bfb89f"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642220__a240459d7eede46d5be7755e46d74f2a2">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_0000001188642220__ad81602b2e1c548d0a6dfeeaa1b145ebe">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_0000001188642220__a81c28af0356c48a4896bbc826c147854">-</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642220__aebabadd9d0484a46aa8b6bfefec15876">SQLException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642220__r17c90d04576c48c59edac1cbe566e3a9"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642220__a444bc06a76ba4676a263d2b94751fdff">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_0000001188642220__a8020189a9e5f480582e47d543a64462b">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_0000001188642220__a22aca0f657954629ad92f47b0c60bbd4">Uses <strong id="EN-US_TOPIC_0000001188642220__b842352706193948">COPY FROM STDIN</strong> to quickly load data to tables in the 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_0000001188642220__afbc83969a7ed48de92dfd867138b2508">SQLException,IOException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642220__ra8e5391633284b85ae175a6002f790ca"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642220__ae9fa748e87934f72a25736ec72d129bf">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_0000001188642220__a10847a0ebca244f08c4903ac3cdfef9a">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_0000001188642220__a8ac518de8bf14965b0332a4b78b37b49">Uses <strong id="EN-US_TOPIC_0000001188642220__b1421568650">COPY FROM STDIN</strong> to quickly load data to tables in the 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_0000001188642220__a2db5058311984dd9ae93f5dcb4384dd6">SQLException,IOException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642220__r452b0d5c470947c1b77a74a2a4f9f154"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642220__a6d9cfaa18d494d8aa3502f2bc5dd1cc2">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_0000001188642220__a28f97988b8f34e14949925cced295e71">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_0000001188642220__a2884eeb30df247188b37fb0ae2a69834">Uses <strong id="EN-US_TOPIC_0000001188642220__b1646535903">COPY FROM STDIN</strong> to quickly load data to tables in the 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_0000001188642220__a7478dcaff1bc4e86a4c6ddbe163433a1">SQLException,IOException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642220__r0e3ac05402b74167b421916391c76883"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642220__a5fcea7829e8f4d7d99e25b21f0a26ac5">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_0000001188642220__a9dc8362a893840e99dbd133e5ed7dd12">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_0000001188642220__a9953efbb922b4024b3f2c387569c67ec">Uses <strong id="EN-US_TOPIC_0000001188642220__b155582424">COPY FROM STDIN</strong> to quickly load data to tables in the 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_0000001188642220__a5374008f0952419281862281cf232b75">SQLException,IOException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642220__r6d50ffe6f8f64a3088b0be84c77a520b"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642220__a225dc1116ceb4e488fafda83a68a611f">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_0000001188642220__ac502b8c654854a68b92288d7f7f38fe6">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_0000001188642220__a62a3cf28d5e94cf5b38f3e086a0ce489">-</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642220__ac3e72f0279364a95ae3cea683cdaf5ad">SQLException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642220__r8175148026c34c6fa58a3cbc7945c80e"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642220__a141dc833aaf349b98360f410099638a7">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_0000001188642220__a295e967aeb04440e9b0a888a475707da">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_0000001188642220__ad11bbea68f77476fad9d26aa0f78b731">Sends the result set of <strong id="EN-US_TOPIC_0000001188642220__b842352706194036">COPY TO STDOUT</strong> from the 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_0000001188642220__a5b268016a3334c61a3075ae930edc85d">SQLException,IOException</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642220__r831580777db2407988553e5cfe9bb12b"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642220__addb90dd02585421581da6b77c55a1a9d">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_0000001188642220__afaab83c8545a407db0d585216c7d68b9">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_0000001188642220__af4083c960af6477597a15e3d78ad7e3c">Sends the result set of <strong id="EN-US_TOPIC_0000001188642220__b1753940891">COPY TO STDOUT</strong> from the 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_0000001188642220__a037fd5b7148a4335827c9512f8dd39b6">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_0102.html">JDBC Interface Reference</a></div>
</div>
</div>