APPFuse--准备数据库

在eclipse中运行ant db-setup,ant中的一些技巧

  • 判断某个库是否合适

        <available classname="org.apache.tools.ant.DynamicAttribute" property="ant-1.6.2"/>
        <fail unless="ant-1.6.2" message="AppFuse requires Ant 1.6.2 for faster unit testing"/>

  • 创建数据库

    <target name="db-create" depends="init"
        description="create database for ${database.type}">
        <echo level="debug">${database.jar}</echo>
        <if>
            <equals arg1="${database.type}" arg2="mysql"/>
            <then>
                <echo message="Detected MySQL, creating database..."/>
                <echo>Creating database with: ${database.type}-create.sql</echo>
                <echo>URL: ${database.admin.url}</echo>
                <sql
                    driver="${database.driver_class}"
                    url="${database.admin.url}"
                    userid="${database.admin.username}"
                    password="${database.admin.password}">

                    <classpath>
                        <pathelement location="${database.jar}"/>
                    </classpath>

                    <fileset dir="metadata/sql">
                        <include name="${database.type}-create.sql"/>
                    </fileset>
                </sql>
            </then>
            <else>
                <echo level="warning">WARNING:</echo>
                <echo>You selected a '${database.type}' database which </echo>
                <echo>does NOT support creating a database via JDBC.  </echo>
                <echo>Please create a '${database.name}' database manually</echo>
                <echo>and then run "ant db-prepare" to create the </echo>
                <echo>database tables.  You might want to check the </echo>
                <echo>metadata/sql directory to see if the file</echo>
                <echo>'${database.type}-create.sql' exists.</echo>
            </else>
        </if>
    </target>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值