zoukankan      html  css  js  c++  java
  • NetBpm 配置篇(2)

    转载注明出处:http://www.cnblogs.com/anbylau2130/p/3877353.html 

    上一篇中介绍了Netbpm在IIS和CassiniWebServer服务器的安装

      

    通过上节的配置应该可以打开主页了

                              

    到这里要说的是数据库配置了

           1,修改数据库连接

                    Netbpm下数据库映射是通过NHibernate来实现的,目录中 app_config.xml是NHibernate的配置文件

              

    <configuration>
        <components>
    
    <!--  This classloader loads classes from assemblies in the database. 
          Different versions of the same process can have use different assemblies.   -->
            <component id="ClassLoader" 
                service="NetBpm.Workflow.Delegation.ClassLoader.IClassLoader, NetBpm" 
                type="NetBpm.Workflow.Delegation.ClassLoader.Impl.DBClassLoader, NetBpm" />
    
    <!--   This classloader loads only classes from the local assemblies   -->
    <!--
            <component id="ClassLoader" 
                service="NetBpm.Workflow.Delegation.ClassLoader.IClassLoader, NetBpm" 
                type="NetBpm.Workflow.Delegation.ClassLoader.Impl.DefaultClassLoader, NetBpm" />
    -->
    
            <component id="OrganisationSession" 
                service="NetBpm.Workflow.Organisation.EComp.IOrganisationSessionLocal, NetBpm" 
                type="NetBpm.Workflow.Organisation.EComp.Impl.OrganisationEComp, NetBpm" />
    
            <component id="SchedulerSession" 
                service="NetBpm.Workflow.Scheduler.EComp.ISchedulerSessionLocal, NetBpm" 
                type="NetBpm.Workflow.Scheduler.EComp.Impl.SchedulerEComp, NetBpm" />
    
            <component id="DefinitionSession" 
                service="NetBpm.Workflow.Definition.EComp.IDefinitionSessionLocal, NetBpm" 
                type="NetBpm.Workflow.Definition.EComp.Impl.DefinitionEComp, NetBpm" />
    
            <component id="ExecutionSession" 
                service="NetBpm.Workflow.Execution.EComp.IExecutionSessionLocal, NetBpm" 
                type="NetBpm.Workflow.Execution.EComp.Impl.ExecutionEComp, NetBpm" />
    
            <component id="LogSession" 
                service="NetBpm.Workflow.Log.EComp.ILogSessionLocal, NetBpm" 
                type="NetBpm.Workflow.Log.EComp.Impl.LogEComp, NetBpm" />
    
            <component id="SchedulerThread" 
                service="NetBpm.Workflow.Scheduler.EComp.Impl.SchedulerThread, NetBpm" 
                type="NetBpm.Workflow.Scheduler.EComp.Impl.SchedulerThread, NetBpm" />
    
        </components>
    
        <facilities>
            <facility 
                id="transactions" 
                type="Castle.Facilities.AutomaticTransactionManagement.TransactionFacility, Castle.Facilities.AutomaticTransactionManagement"/>
    
            <facility id="nhibernate"
                type="Castle.Facilities.NHibernateIntegration.NHibernateFacility, Castle.Facilities.NHibernateIntegration">
                <factory id="nhibernate.factory">
                    <!-- MYSQL Config -->
                    <!--<settings>
                        <item key="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</item>
                        <item key="hibernate.connection.driver_class">NHibernate.Driver.MySqlDataDriver</item>
                        <item key="hibernate.connection.connection_string">Database=nbpm;Data Source=localhost;User Id=nbpm;Password=nbpm</item>
                        <item key="hibernate.dialect">NHibernate.Dialect.MySQLDialect</item>
                    </settings>-->
                    <!-- MSSql Config-->
    
                    <settings>
                        <item key="hibernate.connection.driver_class">NHibernate.Driver.SqlClientDriver</item>
                        <item key="hibernate.dialect">NHibernate.Dialect.MsSql2000Dialect</item>
                        <item key="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</item>
                        <item key="hibernate.connection.connection_string">Data Source=.;uid=sa;pwd=123;database=MyTest</item>
                    </settings>
    
                     <assemblies>
                              <assembly>NetBpm</assembly>
                     </assemblies>
                </factory>
            </facility>
        </facilities>
    
    </configuration>

         我们需要改的只是hibernate.connection.connection_string节点的字符串连接改为我们需要的数据库就行了

      <settings>
                        <item key="hibernate.connection.driver_class">NHibernate.Driver.SqlClientDriver</item>
                        <item key="hibernate.dialect">NHibernate.Dialect.MsSql2000Dialect</item>
                        <item key="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</item>
                        <item key="hibernate.connection.connection_string">Data Source=.;uid=sa;pwd=123;database=MyTest</item>
      </settings>

      2,在你给定的数据库中运行Sql目录下的sql文件--建表

      3,运行Organisation.sql 增加数据库数据即可登录,出现这个界面表示登录成功

  • 相关阅读:
    c# 图片保存为流Stream,再次加载时提示System.ArgumentOutOfRangeException: 要求非负数的解决办法
    VS 2019 Git failed with a fatal error的解决办法
    IIS安全狗卸载后,IIS8.5,网站无法访问的解决方法
    sqlserver 全文检索提高精确度的一个方法
    Win10应用商店打不开的解决办法
    Dapper解析嵌套的多层实体类
    Aspose.Words转换为PDF的时候字体丢失的问题解决
    IIS ASP.NET MVC 上传文件到NAS目录
    windows xp .net framework 4.0 HttpWebRequest 报The underlying connection was closed,基础连接已关闭
    c# 计算中文字节数与JAVA不符的解决方法
  • 原文地址:https://www.cnblogs.com/anbylau2130/p/3877353.html
Copyright © 2011-2022 走看看