ant 操作sql的build.xml写法


<sql
    driver="org.database.jdbcDriver"
    url="jdbc:database-url"
    userid="sa"
    password="pass"
    src="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>

<sql
    driver="org.database.jdbcDriver"
    url="jdbc:database-url"
    userid="sa"
    password="pass"
    ><![CDATA[

update some_table set column1 = column1 + 1 where column2 < 42;

]]></sql>

<sql
    driver="org.hsqldb.jdbcDriver";
    url="jdbc:hsqldb:file:${database.dir}"
    userid="sa"
    password=""
    expandProperties="true"
    >
  <transaction>
    CREATE USER ${newuser} PASSWORD ${newpassword}
  </transaction>
</sql>


<sql driver="${db.driver}" url="${db.url}" userid="${db.username}" password="${db.password}" classpathref="classpath" onerror="continue" print="true">
            <transaction src="./${db.project}/scripts/schemes_insert_data.sql" />
            <transaction src="./${db.project}/scripts/table_access_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/birn_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/custom_meta_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_demographics_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_diagnoses_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_expressions_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_labtests_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_medications_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_modifiers_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_procedures_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_providers_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_reports_insert_data.sql" />
            <transaction src="./${db.project}/scripts/${db.type}/i2b2_metadata_visitDetails_insert_data.sql" />
        </sql>

其他一些写法:
	<ant dir="./" antfile="build.xml" inheritall="off"/>
	<ant antfile="build.xml" target="del_src_class" /> 
	<ant antfile="build.xml" target="compile_java" /> 
	<antcall target="copy_module_file" /> 

	<parallel threadsPerProcessor='3'> 并行编译,并行线程数3
		<ant antfile="build.xml" dir="plugins/org.eclipse.equinox.common" target="build.jars"/>
		<ant antfile="build.xml" dir="plugins/org.eclipse.equinox.p2.jarprocessor" target="build.jars"/>
	</parallel>

你可能感兴趣的:(build.xml)