<p>Executes a series of sql statement via JDBC to a database. Statements can either be read in from a text file using the src attribute or from between the enclosing sql tags.</p>
<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>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</p>
<blockquote><pre><sql
driver="org.database.jdbcDriver"
url="jdbc:database-url"
userid="sa"
password="pass"
>
insert
into table some_table
values(1,2,3,4);
truncate table some_other_table;
</sql>
</pre></blockquote>
<p>Connects to the database given in url as the sa user using the org.database.jdbcDriver and executes the two sql statements inserting data into some_table and truncating some_other_table</p>
<p>Note that you may want to enclose your statements in
<code><![CDATA[</code> ... <code>]]></code> sections so you don't
need to escape <code><</code>, <code>></code><code>&</code>
<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>