本文主要是介绍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>
这篇关于APPFuse--准备数据库的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!