Create Database Schema
Setup JDBC Driver
Edit build.properties in the main AppFuse Directory
Generate Application
Deploy Application
Test Database Access
Step 1
创建一个用户:
CREATE USER
<
database-schema-owner
>
IDENTIFIED BY
<
password
>
;
GRANT CONNECT TO
<
database-schema-owner
>
;
GRANT RESOURCE TO
<
database-schema-owner
>
;
Step 2
Oracle驱动(classes12 for jdk1.2,jdk1.3;ojdbc14 for jdk1.4,1.5)拷贝到{AppFuse home}/lib /oracle
Step 3
修改2个配置文件
build.properties
database.jar=${lib.dir}/oracle/ojdbc14.jar
database.type=oracle
database.host=localhost
#use the database schema owner and password created in step #1 above here
database.username=username
database.password=password
database.schema=schemaname (case sensitive using 10g)
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
database.driver_class=oracle.jdbc.driver.OracleDriver
database.url=jdbc:oracle:thin:@localhost:1521:mySID build.xml 中,添加属性database.schema到dbunit任务
<dbunit driver="${database.driver_class}" schema="${database.schema}"
supportBatchStatement="false" url="${database.url}"
userid="${database.username}" password="${database.password}"> database.schema一般用大写Step 4
new新代码
ant new -Dapp.name=myappname -Ddb.name=mydbnameStep 5
发布 ant new
Step 6
测试: select username, country from app_user;