forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
177 lines
22 KiB
HTML
177 lines
22 KiB
HTML
<a name="dli_08_0197"></a><a name="dli_08_0197"></a>
|
|
|
|
<h1 class="topictitle1">Creating a DLI Table and Associating It with RDS</h1>
|
|
<div id="body1578361312450"><div class="section" id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_section540354616207"><h4 class="sectiontitle">Function</h4><p id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_p13312652114">This statement is used to create a DLI table and associate it with an existing RDS table. This function supports access to the MySQL and PostgreSQL clusters of RDS.</p>
|
|
<div class="note" id="dli_08_0197__note443995614391"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dli_08_0197__dli_08_0119_p964618104214">In Spark cross-source development scenarios, there is a risk of password leakage if datasource authentication information is directly configured. You are advised to use the datasource authentication provided by DLI.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="dli_08_0197__section1886921516407"><h4 class="sectiontitle">Prerequisites</h4><p id="dli_08_0197__p1976716256406">Before creating a DLI table and associating it with RDS, you need to create a datasource connection. For details about operations on the management console, see </p>
|
|
</div>
|
|
<div class="section" id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_section20884135882017"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="dli_08_0197__en-us_topic_0142907233_screen1782941313813"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="p">[</span><span class="k">IF</span><span class="w"> </span><span class="k">NOT</span><span class="w"> </span><span class="k">EXISTS</span><span class="p">]</span><span class="w"> </span><span class="k">TABLE_NAME</span>
|
|
<span class="w"> </span><span class="k">USING</span><span class="w"> </span><span class="n">JDBC</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span>
|
|
<span class="w"> </span><span class="s1">'url'</span><span class="o">=</span><span class="s1">'xx'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'driver'</span><span class="o">=</span><span class="s1">'DRIVER_NAME'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'dbtable'</span><span class="o">=</span><span class="s1">'db_name_in_RDS.table_name_in_RDS'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'passwdauth'</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'xxx'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'encryption'</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'true'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_section784510261216"><h4 class="sectiontitle">Keywords</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_t2fa8597e0dde4884bd6412ac207ebea8" frame="border" border="1" rules="all"><caption><b>Table 1 </b>CREATE TABLE keywords</caption><thead align="left"><tr id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_r16c75fd8fdbf41c79f9aee82b032351c"><th align="left" class="cellrowborder" valign="top" width="15.8%" id="mcps1.3.4.2.2.3.1.1"><p id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_a9dd69379a3f54904a9c510fb817659ad"><strong id="dli_08_0197__b650125102415">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="84.2%" id="mcps1.3.4.2.2.3.1.2"><p id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_a7ede0d62539542baa7e367cf902bf2b2"><strong id="dli_08_0197__en-us_topic_0093946771_en-us_topic_0053447306_en-us_topic_0039551470_b6335010717346">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_row9789172211455"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_p1783227111576">url</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_p216518281377">Before obtaining the RDS IP address, you need to create a datasource connection first.. </p>
|
|
<p id="dli_08_0197__en-us_topic_0142907233_p17658829185311">After an enhanced datasource connection is created, use the internal network domain name or internal network address and database port number provided by RDS to connect to DLI. If MySQL is used, the format is <strong id="dli_08_0197__b197693862414"><em id="dli_08_0197__i1875143812410">protocol header</em>://<em id="dli_08_0197__i4757382246">internal IP address</em>:<em id="dli_08_0197__i2768386240">internal network port number</em></strong>. If PostgreSQL is used, the format is <strong id="dli_08_0197__b178838192411"><em id="dli_08_0197__i776193813242">protocol header</em>://<em id="dli_08_0197__i67733882412">internal IP address</em>:<em id="dli_08_0197__i577133872411">internal network port number</em>/<em id="dli_08_0197__i1478123852412">database name</em></strong>.</p>
|
|
<p id="dli_08_0197__en-us_topic_0142907233_p14832153644513">For example: <strong id="dli_08_0197__b932218404249">jdbc:mysql://192.168.0.193:3306</strong> or <strong id="dli_08_0197__b8322184082413">jdbc:postgresql://192.168.0.193:3306/postgres</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_row166137253465"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_p584237211576">driver</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_p5902520811576">JDBC driver class name. To connect to a MySQL cluster, enter <strong id="dli_08_0197__b18511195062418">com.mysql.jdbc.Driver</strong>. To connect to a PostgreSQL cluster, enter <strong id="dli_08_0197__b551235020246">org.postgresql.Driver</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_row193609262164"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_p247311352164">dbtable</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><ul id="dli_08_0197__ul127841380312"><li id="dli_08_0197__li204581543334">To access the MySQL cluster, enter <strong id="dli_08_0197__b6964103474511"><em id="dli_08_0197__i18926137194512">Database name</em>.<em id="dli_08_0197__i8567542154513">Table name</em></strong>.<div class="caution" id="dli_08_0197__note1964144402719"><span class="cautiontitle"> CAUTION: </span><div class="cautionbody"><p id="dli_08_0197__p1664184410270">The name of the RDS database cannot contain hyphens (-) or ^. Otherwise, the table fails to be created.</p>
|
|
</div></div>
|
|
</li><li id="dli_08_0197__li147843384317">To access the PostGre cluster, enter <strong id="dli_08_0197__b41098817464"><em id="dli_08_0197__i117431711154611">Schema name</em>.<em id="dli_08_0197__i1980814134616">Table name</em></strong><div class="note" id="dli_08_0197__note38895718317"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dli_08_0197__p19961857633">The schema name is the name of the database schema. A schema is a collection of database objects, including tables and views.</p>
|
|
</div></div>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_row469853952167"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_p477206762167">user</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_p401695862167">(Discarded) Specifies the RDS username.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_row16373105816236"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_p153731658142316">password</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_p937385862313">(Discarded) Specifies the RDS username and password.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__row18815181412240"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__p367053022018">passwdauth</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0151059555_p562616372455">Datasource password authentication name. For details about how to create datasource authentication, see Datasource Authentication in the <em id="dli_08_0197__i564711316015">Data Lake Insight User Guide</em>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__row28154141241"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__p1073983512205">encryption</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__p13739113518204">Set this parameter to <span class="parmvalue" id="dli_08_0197__parmvalue24212169212"><b>true</b></span> when datasource password authentication is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_row144819311368"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_p115736213142">partitionColumn</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_p657314251414">This parameter is used to set the numeric field used concurrently when data is read.</p>
|
|
<div class="note" id="dli_08_0197__en-us_topic_0142907233_note84102206211"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="dli_08_0197__en-us_topic_0142907233_ul878014413281"><li id="dli_08_0197__li1436419519251">The <span class="parmname" id="dli_08_0197__parmname1560767174812"><b>partitionColumn</b></span>, <span class="parmname" id="dli_08_0197__parmname655431374813"><b>lowerBound</b></span>, <span class="parmname" id="dli_08_0197__parmname1692201619489"><b>upperBound</b></span>, and <span class="parmname" id="dli_08_0197__parmname1669612164812"><b>numPartitions</b></span> parameters must be set at the same time.</li><li id="dli_08_0197__li1336731812252">To improve the concurrent read performance, you are advised to use auto-increment columns.</li></ul>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_row16447173143617"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_p17774145171412">lowerBound</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_p8774175121411">Minimum value of a column specified by <strong id="dli_08_0197__b441021413257">partitionColumn</strong>. The value is contained in the returned result.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_row1544743173619"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_p106263918145">upperBound</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_p09634592231">Maximum value of a column specified by <strong id="dli_08_0197__b1938101642510">partitionColumn</strong>. The value is not contained in the returned result.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_row1944610312362"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_p175509134149">numPartitions</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_p135501013191415">Number of concurrent read operations.</p>
|
|
<div class="note" id="dli_08_0197__en-us_topic_0142907233_note1178124011241"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dli_08_0197__en-us_topic_0142907229_p3178240102415">When data is read, the number of concurrent operations are evenly allocated to each task according to the <span class="parmname" id="dli_08_0197__parmname12111944144816"><b>lowerBound</b></span> and <span class="parmname" id="dli_08_0197__parmname193615502488"><b>upperBound</b></span> to obtain data. The following is an example:</p>
|
|
<pre class="screen" id="dli_08_0197__screen694310962920">'partitionColumn'='id',
|
|
'lowerBound'='0',
|
|
'upperBound'='100',
|
|
'numPartitions'='2'</pre>
|
|
<p id="dli_08_0197__en-us_topic_0142907229_p1361474310301">Two concurrent tasks are started in DLI. The execution ID of one task is greater than or equal to <strong id="dli_08_0197__b88898769892456">0</strong> and the ID is less than <strong id="dli_08_0197__b85032847892456">50</strong>, and the execution ID of the other task is greater than or equal to <strong id="dli_08_0197__b74398035092456">50</strong> and the ID is less than <strong id="dli_08_0197__b118154304092456">100</strong>.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_row4445831173619"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_p10294816131410">fetchsize</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_p20295111641419">Number of data records obtained in each batch during data reading. The default value is <strong id="dli_08_0197__b195101277254">1000</strong>. If this parameter is set to a large value, the performance is good but more memory is occupied. If this parameter is set to a large value, memory overflow may occur.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_row64455316361"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_p714473981918">batchsize</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_p14144123961915">Number of data records written in each batch. The default value is <strong id="dli_08_0197__b107431831152510">1000</strong>. If this parameter is set to a large value, the performance is good but more memory is occupied. If this parameter is set to a large value, memory overflow may occur.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_row14441314364"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_p17393542141920">truncate</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_p339304231915">Indicates whether to clear the table without deleting the original table when <strong id="dli_08_0197__b377311345251">overwrite</strong> is executed. The options are as follows:</p>
|
|
<ul id="dli_08_0197__en-us_topic_0142907233_ul1553014522289"><li id="dli_08_0197__en-us_topic_0142907233_li253165232816">true</li><li id="dli_08_0197__en-us_topic_0142907233_li353145272812">false</li></ul>
|
|
<p id="dli_08_0197__en-us_topic_0142907233_p1212110107349">The default value is <span class="parmvalue" id="dli_08_0197__parmvalue9292113718258"><b>false</b></span>, indicating that the original table is deleted and then a new table is created when the <strong id="dli_08_0197__b529216373257">overwrite</strong> operation is performed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0197__en-us_topic_0142907233_row04431331133619"><td class="cellrowborder" valign="top" width="15.8%" headers="mcps1.3.4.2.2.3.1.1 "><p id="dli_08_0197__en-us_topic_0142907233_p73369516203">isolationLevel</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="84.2%" headers="mcps1.3.4.2.2.3.1.2 "><p id="dli_08_0197__en-us_topic_0142907233_p113361357206">Transaction isolation level. The options are as follows:</p>
|
|
<ul id="dli_08_0197__en-us_topic_0142907233_ul10230121722910"><li id="dli_08_0197__en-us_topic_0142907233_li6230171717299">NONE</li><li id="dli_08_0197__en-us_topic_0142907233_li14230161720291">READ_UNCOMMITTED</li><li id="dli_08_0197__en-us_topic_0142907233_li5230517172919">READ_COMMITTED</li><li id="dli_08_0197__en-us_topic_0142907233_li023011711299">REPEATABLE_READ</li><li id="dli_08_0197__en-us_topic_0142907233_li16230191742920">SERIALIZABLE</li></ul>
|
|
<p id="dli_08_0197__en-us_topic_0142907233_p1895985011353">The default value is <span class="parmvalue" id="dli_08_0197__parmvalue6969114111258"><b>READ_UNCOMMITTED</b></span>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_section1856617202225"><h4 class="sectiontitle">Precautions</h4><p id="dli_08_0197__en-us_topic_0142907233_p912611523415">When creating a table associated with RDS, you do not need to specify the <strong id="dli_08_0197__b29521246102519">Schema</strong> of the associated table. DLI automatically obtains the schema of the table in the <strong id="dli_08_0197__b5362548122511">dbtable</strong> parameter of RDS.</p>
|
|
</div>
|
|
<div class="section" id="dli_08_0197__en-us_topic_0142907233_en-us_topic_0114776213_en-us_topic_0103157088_section9892337112213"><h4 class="sectiontitle">Example</h4><p id="dli_08_0197__en-us_topic_0142907233_p14325175413169">Accessing MySQL</p>
|
|
<div class="codecoloring" codetype="Sql" id="dli_08_0197__en-us_topic_0142907233_screen156701345141612"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="k">IF</span><span class="w"> </span><span class="k">NOT</span><span class="w"> </span><span class="k">EXISTS</span><span class="w"> </span><span class="n">dli_to_rds</span>
|
|
<span class="w"> </span><span class="k">USING</span><span class="w"> </span><span class="n">JDBC</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span>
|
|
<span class="w"> </span><span class="s1">'url'</span><span class="o">=</span><span class="s1">'jdbc:mysql://to-rds-117405104-3eAHxnlz.datasource.com:3306'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'driver'</span><span class="o">=</span><span class="s1">'com.mysql.jdbc.Driver'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'dbtable'</span><span class="o">=</span><span class="s1">'rds_test.test1'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'passwdauth'</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'xxx'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'encryption'</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'true'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="dli_08_0197__en-us_topic_0142907233_p745183812161"></p>
|
|
<p id="dli_08_0197__en-us_topic_0142907233_p16301338191615">Accessing PostgreSQL</p>
|
|
<div class="codecoloring" codetype="Sql" id="dli_08_0197__en-us_topic_0142907233_screen1925230124414"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="k">IF</span><span class="w"> </span><span class="k">NOT</span><span class="w"> </span><span class="k">EXISTS</span><span class="w"> </span><span class="n">dli_to_rds</span>
|
|
<span class="w"> </span><span class="k">USING</span><span class="w"> </span><span class="n">JDBC</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span>
|
|
<span class="w"> </span><span class="s1">'url'</span><span class="o">=</span><span class="s1">'jdbc:postgresql://to-rds-1174405119-oLRHAGE7.datasource.com:3306/postgreDB'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'driver'</span><span class="o">=</span><span class="s1">'org.postgresql.Driver'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'dbtable'</span><span class="o">=</span><span class="s1">'pg_schema.test1'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'passwdauth'</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'xxx'</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s1">'encryption'</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'true'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0196.html">Creating a Datasource Connection with an RDS Table</a></div>
|
|
</div>
|
|
</div>
|
|
|