- Add new attributes onerror= (continue, stop, abort) to <sql>
- Add new nested element <transaction> to <sql> which allows executing
multiple transactions, multiple files on the same connection.
- Added documentation on sql.html
- Modified AntClassLoader.java to send most of the "loading class..."
messages to MSG_DEBUG instead of MSG_VERBOSE. So that it does not
cluter debugging other tasks.
- Add new attributes 'rdbms="product"' and 'version="release"'
if those versions do not match what is returned by the connection, the
task will be skipped.
Submitted by: Jose Alberto Fernandez <JFernandez@viquity.com>
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268049 13f79535-47bb-0310-9956-ffa450edef68
<p>Multiple statements can be set and each statement is delimited from the next use a semi-colon. Individual lines within the statements can be commented using either -- or // at the start of the line.</p>
<p>The auto-commit attribute specifies whether auto commit should be turned on or off whilst executing the statements. If auto-commit is turned on each statement will be executed and commited. If it is turned off the statements will all be executed as one transaction.</p>
<p>The <i>onerror</i> attribute specifies how to preceed when an error occurs during the execution of one of the statements.
The possible values are: <b>continue</b> execution, only show the error;
<b>stop</b> execution and commit transaction;
and <b>abort</b> execution and transaction and fail task.
<td valign="top" align="center">Yes, unless statements enclosed within tags</td>
</tr>
</table>
<h4>classpath</h4>
<p><code>Sql</code>'s <em>classpath</em> attribute is a <a
href="#path">PATH like structure</a> and can also be set via a nested
<em>classpath</em> element. It is used to load the JDBC classes.</p>
<p>
The
</p>
<h3>Examples</h3>
<pre><blockquote><sql
@@ -114,6 +162,22 @@ update some_table set column1 = column1 + 1 where column2 < 42;
]]></sql>
</pre></blockquote>
<p>The following connects to the database given in url as the sa user using the org.database.jdbcDriver and executes the sql statements contained within the files data1.sql, data2.sql and data3.sql and then executes the truncate operation on <i>some_other_table</i>.</p>
<pre><blockquote><sql
driver="org.database.jdbcDriver"
url="jdbc:database-url"
userid="sa"
password="pass" >
<transaction src="data1.sql" />
<transaction src="data2.sql" />
<transaction src="data3.sql" />
<transaction>
truncate table some_other_table;
</transaction>
</sql>
</pre></blockquote>
<p>The following connects to the database given in url as the sa user using the org.database.jdbcDriver and executes the sql statements contained within the file data.sql, with output piped to outputfile.txt, searching /some/jdbc.jar as well as the system classpath for the driver class.</p>
<pre><blockquote><sql
@@ -131,6 +195,25 @@ update some_table set column1 = column1 + 1 where column2 < 42;
</sql>
</pre></blockquote>
<p>The following will only execute if the RDBMS is "oracle" and the version starts with "8.1."</p>
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.