日期:2014-05-16 浏览次数:20419 次
<project name="sfamx.cleanupdb" default="cleanup.db.logging"> <dirname property="sfamx.ddl.dir" file="${ant.file.sfamx.ddl.build}"/> <target name="cleanupall" depends="replace.db.password, cleanup.db.logging"/> <path id="jdbc.classpath"> <fileset dir="${db.driver.path}" includes="*.jar"/> </path> <property name="plaintext.password" value="${plainText}"/> <target name="replace.db.password"> <script language="javascript"> <classpath> <!-- for xxx 3.2 --> <pathelement location="${tibco.home}/components/shared/1.0.0/plugins/com.tibco.security.tibcrypt_2.15.0.009.jar"/> <pathelement location="${tibco.home}/components/shared/1.0.0/plugins/com.tibco.tpcl.org.slf4j.log4j12_1.6.200.001/slf4j-log4j12-1.5.2.jar"/> <pathelement location="${tibco.home}/components/shared/1.0.0/plugins/com.tibco.tpcl.org.slf4j.log4j12_1.6.200.001/slf4j-api-1.5.2.jar"/> <pathelement location="${tibco.home}/components/shared/1.0.0/plugins/com.tibco.tpcl.org.apache.log4j_1.2.400.002/log4j-1.2.15.jar"/> <!-- for xxx 3.1.5 --> <pathelement location="${tibco.home}/components/shared/1.0.0/plugins/com.tibco.security.tibcrypt_2.14.300.006.jar"/> <pathelement location="${tibco.home}/components/shared/1.0.0/plugins/com.tibco.tpcl.org.slf4j.log4j12_1.5.101.001/slf4j-log4j12-1.5.2.jar"/> <pathelement location="${tibco.home}/components/shared/1.0.0/plugins/com.tibco.tpcl.org.slf4j.log4j12_1.5.101.001/slf4j-api-1.5.2.jar"/> <pathelement location="${tibco.home}/components/shared/1.0.0/plugins/com.tibco.tpcl.org.apache.log4j_1.2.300.004/log4j-1.2.15.jar"/> </classpath> <![CDATA[ importPackage(com.tibco.security); var encryptedPassword = project.getProperty("admin.db.password"); var decryptedPassword = ObfuscationEngine.decrypt(encryptedPassword); var plainText = new java.lang.String(decryptedPassword); project.setProperty("plaintext.password", plainText) ]]> </script> </target> <target name="cleanup.db.logging" depends="replace.db.password" description="Run ddl to cleanup commonlogging tables in external database for amx administrator"> <sql driver="${admin.db.driver}" url="${admin.db.url}" userid="${admin.db.username}" password="${plaintext.password}" print="yes"> <classpath refid="jdbc.classpath"/> <transaction src="./${db.ddl.path}/drop_commonlogging.ddl"/> </sql> </target> </project>