doc-exports/docs/dws/dev/dws_04_0103.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

124 lines
11 KiB
HTML

<a name="EN-US_TOPIC_0000001188163730"></a><a name="EN-US_TOPIC_0000001188163730"></a>
<h1 class="topictitle1">java.sql.Connection</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001188163730__ab49278885e16496995c1846d62d6db78">This section describes <strong id="EN-US_TOPIC_0000001188163730__b842352706151438">java.sql.Connection</strong>, the interface for connecting to a database.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188163730__t487bd16d6cfe49408506a727d68a6dd0" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Support status for java.sql.Connection</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188163730__r59507112b645488bb4d8de366e2ca397"><th align="left" class="cellrowborder" valign="top" width="37.86%" id="mcps1.3.2.2.4.1.1"><p id="EN-US_TOPIC_0000001188163730__aa51b5364b0074898bd9970e0081812dd">Method Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="32.32%" id="mcps1.3.2.2.4.1.2"><p id="EN-US_TOPIC_0000001188163730__adc17880a1efb4119989ba195475ba6a5">Return Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="29.82%" id="mcps1.3.2.2.4.1.3"><p id="EN-US_TOPIC_0000001188163730__a06a314f272b647678f5a4bac94467046">Support JDBC 4</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188163730__r77ebd7377c084e979b2e78aa0af5e361"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__a10ec0f44222341f686554623eecdc3da">close()</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__a0863416e17844dab887598d2e11c78fa">void</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__a1a9a7e21cd604aecb9bcab9b22351b1d">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__r663b771f8594425692ea5e5d0c578221"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__aba962092a54d45f4be086a457c2fb8c6">commit()</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__a41804cad6a1745ddba0ddd5541931ff4">void</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__a2f5401ed488c45338e5eaa76915fc349">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__r6ed9a559001f4b69a11eb31c4c7c42dd"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__a3470610efcd543d29e7e1ecfb78e425d">createStatement()</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__afb48bc04e3944cb4859ec06550753fb1">Statement</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__a03ced1da2472451aa069272bd30268d4">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__r924449824d8a4ca7a5912bb7715d84d6"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__ac1497b4109e348ae93d3d8b3690c43e4">getAutoCommit()</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__acbe5dc28ff3946c5ae4e0fef107cb1fa"><span id="EN-US_TOPIC_0000001188163730__text28411471284">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__aa3d437b732aa4c80ba45f8f5cee02fbe">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__rc63e153b4b43486cacc4b66e1f1542e4"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__a559df14da911408cbc1dc76c3d736c8b">getClientInfo()</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__a4b9bd12c85514d969e46e99bc5bb3d52">Properties</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__a9df35d8d4db24f0a8a63ba871f150da1">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__rce53bd1c5008472b90d1c2731e8a93b0"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__aabbfb80b5998486d989c3b019ed97854">getClientInfo(String name)</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__ada9a761ebe9c4bc7bae1ed4b29ee2352">String</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__ac2bd501d170c4608b552280217b10c22">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__rf3627298ef394c2db0c33d004cdf8452"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__adfc21a1beae6463c9afe8b21eb57e10a">getTransactionIsolation()</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__a2b0dc08fb93741739a5d0cb8ab03627d">int</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__ad5bb844da0fa4f4c83419a5291e0ed4e">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__r46ecbed06e164f59afbf1425d65ebbc2"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__a0ff7d5b0f19441449c3844c863b94cc2">isClosed()</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__a3edadd5c039149c5a4cc90ae639132e2"><span id="EN-US_TOPIC_0000001188163730__text681112562087">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__adda7a23d9ab247a5a3fbf47895f5ce7b">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__rfd59aae859524fa1a34cd81cd6c2e3db"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__a4766f2a2683b4355850147b3df04ec63">isReadOnly()</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__ac1c485d46f824651892fe01eb2984eea"><span id="EN-US_TOPIC_0000001188163730__text1794555714817">boolean</span></p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__ace083be0bef84e60b70147663fe9cec3">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__r13210b98ab4442b3bea45df1ab6f4ae5"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__a557308eb0cc040c7bd091ecf05e33d22">prepareStatement(String sql)</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__a3bc00d02a3124669bb1b958aef26f569">PreparedStatement</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__afe318ba3343545d79a5dab437e006293">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__r584d658b95314ab5b0578faa923ff5e1"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__abe199bdfbd884836a13cb65ba37e06fe">rollback()</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__a92b6890f3b76408598dc01eb0ce72097">void</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__a73428fc0c9a24dc19c8631600cb1b736">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__rcec9f2efc0744b30a3c9a24a9fdeceab"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__a6e801f1093134cec8d7e2c0355b1dc00">setAutoCommit(boolean autoCommit)</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__a14f4056ed8f444a48c48ad16c19c7495">void</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__a69352c3c745c4443bf039e2a3aa630b1">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__r8e74646964b34d60ad84fb5b8703fcd1"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__a76ac91c646934c34972e044140f8616c">setClientInfo(Properties properties)</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__ab2a6ef0ff0674ac29d98a96b255b6931">void</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__a3c39107c94f748b59fdfe55908a8c753">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188163730__r2183ccb7142543b59806913a41ccd06c"><td class="cellrowborder" valign="top" width="37.86%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001188163730__a20ff55cbb7794b23a917d6c61b4804ae">setClientInfo(String name,String value)</p>
</td>
<td class="cellrowborder" valign="top" width="32.32%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001188163730__abf3afab792ee4b8fbb1ff92197d6a40e">void</p>
</td>
<td class="cellrowborder" valign="top" width="29.82%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001188163730__ada682a0f7bf34d2cb8bb95e2d0033766">Yes</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="notice" id="EN-US_TOPIC_0000001188163730__n99222da7597043b3ab332bcf3310462b"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188163730__a614cdf53dd7343468f8dcb29fd2b34dd">The AutoCommit mode is used by default within the interface. If you disable it running <strong id="EN-US_TOPIC_0000001188163730__b84235270620115">setAutoCommit(false)</strong>, all the statements executed later will be packaged in explicit transactions, and you cannot execute statements that cannot be executed within transactions.</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>