Author: jeff.yuchang
Date: 2010-01-19 01:07:26 -0500 (Tue, 19 Jan 2010)
New Revision: 465
Modified:
trunk/distribution/src/main/release/db/build.xml
Log:
* add show table sql statement for easily debugging.
Modified: trunk/distribution/src/main/release/db/build.xml
===================================================================
--- trunk/distribution/src/main/release/db/build.xml 2010-01-16 11:45:38 UTC (rev 464)
+++ trunk/distribution/src/main/release/db/build.xml 2010-01-19 06:07:26 UTC (rev 465)
@@ -11,6 +11,22 @@
<available file="${basedir}/../../libs/ojdbc14.jar" />
</condition>
+ <condition property="show.table.sql" value="show tables;">
+ <equals arg1="${database}" arg2="mysql" />
+ </condition>
+
+ <condition property="show.table.sql" value="select table_name from
information_schema.tables where table_schema='public' and table_type='BASE
TABLE';">
+ <equals arg1="${database}" arg2="postgres" />
+ </condition>
+
+ <condition property="show.table.sql" value="select table_name from
tabs;">
+ <equals arg1="${database}" arg2="oracle" />
+ </condition>
+
+ <condition property="show.table.sql" value="select name from
riftsaw..sysobjects where xtype = 'U';">
+ <equals arg1="${database}" arg2="sqlserver" />
+ </condition>
+
<!-- ### LOG PROPERTIES ################################################# -->
<target name="log.properties">
<echo message="database....... ${database}" />
@@ -32,7 +48,7 @@
userid="${username}"
password="${password}"
onerror="continue"
- src="../modules/riftsaw.sar/bpel-sql/bpel.${database}.sql">
+ src="../modules/riftsaw.sar/bpel-sql/${database}.sql">
<classpath>
<fileset dir="drivers">
<include name="*.jar"/>
@@ -59,4 +75,23 @@
</sql>
</target>
+ <!-- ### Show tables in the database ############################### -->
+ <target name="db.show.tables"
+ depends="log.properties, copy.ojdbc"
+ description="show tables in db">
+ <sql driver="${driver}"
+ url="${connection.url}"
+ userid="${username}"
+ password="${password}"
+ onerror="continue"
+ print="true">
+ ${show.table.sql}
+ <classpath>
+ <fileset dir="drivers">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+ </sql>
+ </target>
+
</project>
Show replies by date