`
zwm
  • 浏览: 273932 次
  • 性别: Icon_minigender_1
  • 来自: 郑州
社区版块
存档分类
最新评论

初始化jBPM数据表至相应数据库

阅读更多
初始化jBPM数据表至相应数据库(MS SQLServer 2000)
@Author:zwm
@Blog:http://blog.csdn.net/zhaowenming21
@Date:2007-8-25
JBoss官方http://www.jboss.com
下载jbpm-starters-kit-3.1.4解压至本地E:\ jbpm-starters-kit-3.1.4\下,
解压后的目录格式为
E:\ jbpm-starters-kit-3.1.4\
                            +Jbpm
                            + jbpm-bpel
                            + jbpm-db
                            + jbpm-designer
                            + jbpm-server
                            readme.html
现在,进行ant工具的配置
配置两个环境变量:
1.      ant_home: C:\eclipse\plugins\org.apache.ant_1.6.5
2.      Path: C:\eclipse\plugins\org.apache.ant_1.6.5\bin
 
配置文件修改项:进入jbpm\目录下,进行相关修改(鉴于个人机器性能因素,没有采用Oracle,使用SQLServer,应该与数据库类别关系不大呵)
1.              进入jbpm\src\config.files\下,修改hibernate.cfg.xml(注,加粗部分为修改后的结果,下同)
<!-- jdbc connection properties -->
    <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
    <property name="hibernate.connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
    <property name="hibernate.connection.url">jdbc:microsoft:sqlserver://localhost:1433;databaseName=jbpm</property>
    <property name="hibernate.connection.username">sa</property>
    <property name="hibernate.connection.password"></property>
 
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
2.              进入jbpm\src\resources\ 下,创建一个mysqlserver文件夹,将jbpm\src\resources\hsqldb下的两个文件拷贝至刚才新建的mysqlserver文件夹下,修改这个文件create.db.hibernate.properties
# these properties are used by the build script to create
# a hypersonic database in the build/db directory that contains
# the jbpm tables and a process deployed in there
 
hibernate.dialect=org.hibernate.dialect.SQLServerDialect
hibernate.connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver
hibernate.connection.url=jdbc:microsoft:sqlserver://localhost:1433;databaseName=jbpm
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.show_sql=true
 
hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
3.              进入jbpm\下,修改build.deploy.xml文件的SERVER那一段(即指定刚才建立的mysqlserver文件夹目录)
<!-- ============== -->
 <!-- === SERVER === -->
 <!-- ============== -->
 <target name="create.db" depends="declare.jbpm.tasks, db.clean, db.start" description="creates a hypersonic database with the jbpm tables and loads the processes in there">
    <jbpmschema actions="create"
                cfg="${basedir}/src/config.files/hibernate.cfg.xml"
                properties="${basedir}/src/resources/mysqlserver/create.db.hibernate.properties"/>
    <loadidentities file="${basedir}/src/resources/mysqlserver/identity.db.xml"
                cfg="${basedir}/src/config.files/hibernate.cfg.xml"
                properties="${basedir}/src/resources/mysqlserver/create.db.hibernate.properties"/>
    <ant antfile="build.xml" target="build.processes" inheritall="false" />
    <deployprocess cfg="${basedir}/src/config.files/hibernate.cfg.xml"
                   properties="${basedir}/src/resources/mysqlserver/create.db.hibernate.properties">
      <fileset dir="build" includes="*.process" />
    </deployprocess>
    <antcall target="db.stop" />
 </target>
 
4.        拷贝驱动文件SQLServer的三个驱动(msbase.jar, mssqlserver.jar, msutil.jar)jbpm\lib
另外,记得在sqlserver下创建一个jbpm数据库哦.
现在进行ant构建
运行cmd>进入E:\jbpm-starters-kit-3.1.4\jbpm\
执行ant create.db buildfile build.deploy.xml
如果不出其它异常(但我这还是出现点异常信息,不过表是创建成功了,呵呵,不知道是否应该关注异常信息)
认真数一下,33张以JBPM_**开头的数据表毅然矗立在你的眼前!谢谢您的阅读,希望得到您的指点(Msn:zhaowenming21@hotmail.com,QQ:312837814)
分享到:
评论
1 楼 xiaobojava 2009-10-21  
谢谢博主,今天学习了一下jbpm,结果用ant构造数据库时报找不到数据库驱动,看了博主的这篇文章知道驱动包放的位置。谢谢!

相关推荐

Global site tag (gtag.js) - Google Analytics