DB_*/**/*.sql
Here is a variation to perform an action if one or more files exist corresponding to a wildcard filter. That is, you don't know the exact name of the file.
Here, we are looking for "*.sql" files in any sub-directories called "DB_*", recursively. You can adjust the filter to your needs.
NB: Apache Ant 1.7 and higher!
Here is the target to set a property if matching files exist:
<target name="check_for_sql_files">
<condition property="sql_to_deploy">
<resourcecount when="greater" count="0">
<fileset dir="." includes="DB_*/**/*.sql"/>
</resourcecount>
</condition>
</target>
Here is a "conditional" target that only runs if files exist:
<target name="do_stuff" depends="check_for_sql_files" if="sql_to_deploy">
<!-- Do stuff here -->
</target>