forked from docs/doc-exports
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>
111 lines
9.6 KiB
HTML
111 lines
9.6 KiB
HTML
<a name="EN-US_TOPIC_0000001233563141"></a><a name="EN-US_TOPIC_0000001233563141"></a>
|
|
|
|
<h1 class="topictitle1">java.sql.Statement</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001233563141__en-us_topic_0059777679_p430314307188">This section describes <strong id="EN-US_TOPIC_0000001233563141__b842352706164843">java.sql.Statement</strong>, the interface for executing SQL statements.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233563141__tbeb4ea45f27f4e309a0f5115b29213b0" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Support status for java.sql.Statement</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233563141__r457728b2c2744a2e89f722ebeb57b0e6"><th align="left" class="cellrowborder" valign="top" width="32.22%" id="mcps1.3.2.2.4.1.1"><p id="EN-US_TOPIC_0000001233563141__a446667a27c2e456a94c15899dad311c7">Method Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="35.18%" id="mcps1.3.2.2.4.1.2"><p id="EN-US_TOPIC_0000001233563141__aedd5890934ec4b87bdde27b10dbb592c">Return Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="32.6%" id="mcps1.3.2.2.4.1.3"><p id="EN-US_TOPIC_0000001233563141__a21dd33b6c40c47b68b73e6e149601995">Support JDBC 4</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001233563141__rddd18f16b8da47c995386c805aac7b52"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__a0f24bd75986e45aab6cb8172dc7eb5cb">close()</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__ad89732480a1f4a5185984b298ffcbb70">void</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__ae39d80d2a18e4f37b88eb564835a5eac">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__ra297c4567d14427aa805c1f4b7a364b5"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__aa567fc4ea1b24864ab6e9474f6105659">execute(String sql)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__acfa04496a21447e581c25a8363bdc618"><span id="EN-US_TOPIC_0000001233563141__text1121714398138">boolean</span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__a4a6668767a084397a23b8db835d7f24a">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__r0e06459b1373420c90b5f2cc4c87b8b7"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__ad5b2f112671a441b93191e28e16c02e2">executeQuery(String sql)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__a9296041cc69d4a808efc09e8435c09fd">ResultSet</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__ae982f394531a47ad88cce5e789f8c0c9">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__r900994352e5e41e0ac6ea36634b268e3"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__a27666718af0c477e9249e05ff4b9ebd6">executeUpdate(String sql)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__ad44c0b19b8e549ceb63cc8d28c0d50eb">int</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__abe70e435bea547f89d6de270c497a835">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__r826f8c05d2fa40519e31d1449f5cb1d3"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__a3a3b86b6349445539fb7e0307241cd91">getConnection()</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__af7a0c3782f0a42248248aafd3e85e8fe">Connection</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__aee72f8e0188949c2b7ac441e3728ede4">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__reb1754c149da4d8294c5d4a7434bda4a"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__ab1508aef2f764608802746d7586f5aa7">getResultSet()</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__ac46d7cac48b440f5b6db9b254ec57b44">ResultSet</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__a2e74c91b4d044eaeab51eccb94b7ae21">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__r8877f1ad78ed40e8822cbeba9d83969f"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__a48b373b48b374ba5a280ee4940c4dcf3">getQueryTimeout()</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__aa5a43b2efd3848bd833f05c4fc427d06">int</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__af01cc1cc9fc34cb8afd1774900bbb016">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__rdddb9050e3674f4598ecad90cab723f6"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__a9f2529fa0e474862bff55a205ce2c097">getUpdateCount()</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__a3c4c9f4acf784e02814b16f2d8ed1b1e">int</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__a8219e419d1c74db598605b6cae4ee0c7">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__rdb6583b43fa4449ca03a8764b37b5303"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__abcea33e561a34e3b8cfdf15520ba5a00">isClosed()</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__a836f8d659d054262a324a294f5f8fd82"><span id="EN-US_TOPIC_0000001233563141__text717104015131">boolean</span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__a2f887eefb8b742b796ed6a4d20062d3c">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__r03e0369d23ab4fc0be9825284952c6d3"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__a97569dcdb4524988b8cee12e653262a4">setQueryTimeout(int seconds)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__a8298ea0938204c48a632267adec155fe">void</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__aa7f779b099bf4f1c99639bb4fd7375fc">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__r62c43c43fcbb4430b95ed98a657a60d9"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__aebed2439ce744a2cb0d291881500203d">setFetchSize(int rows)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__a760e3ea448c64188a220e9ac3d15a770">void</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__a00d364cbff2249c48fc80d3a321c1c81">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001233563141__r034dce6d5e2245f3b24df7abc3655a26"><td class="cellrowborder" valign="top" width="32.22%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001233563141__a0de0cc082a9044058e96e0fc0832be52">cancel()</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="35.18%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001233563141__a6da8801246d3451da6184ef42bf5bab9">void</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.6%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001233563141__a572bb232306f4fc7add2d47e54af6e3c">Yes</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001233563141__n894afca38a5b441dbedd1c1570414b19"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001233563141__a1abf9540ed034db6a5cfafed7d950134">Using setFetchSize can reduce the memory occupied by result sets on the client. Result sets are packaged into cursors and segmented for processing, which will increase the communication traffic between the database and the client, affecting performance.</p>
|
|
<p id="EN-US_TOPIC_0000001233563141__aadc50ff884e8410b92ee13ef65435f27">Database cursors are valid only within their transaction. If <strong id="EN-US_TOPIC_0000001233563141__b842352706163342">setFetchSize</strong> is set, set <strong id="EN-US_TOPIC_0000001233563141__b84235270616341">setAutoCommit(false)</strong> and commit transactions on the connection to flush service data to a database.</p>
|
|
</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>
|
|
|