Download Ant User Manual

Transcript
Ant User Manual
6.46.3 Parameters specified as nested elements
6.46.3 Parameters specified as nested elements
6.46.3.1 transaction
Use nested <transaction> elements to specify multiple blocks of commands to the executed executed
in the same connection but different transactions. This is particularly useful when there are multiple files
to execute on the same schema.
Attribute Description
src
Required
File containing SQL statements Yes, unless statements enclosed within tags
6.46.3.2 classpath
Sql’s classpath attribute is a PATH like structure [p 13] and can also be set via a nested classpath
element. It is used to load the JDBC classes.
The
6.46.4 Examples
<sql
driver="org.database.jdbcDriver"
url="jdbc:database-url"
userid="sa"
password="pass"
src="data.sql"
/>
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
<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>
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
- 123 -