標籤:style blog http color os 檔案 io 資料
轉載註明出處: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 增加資料庫資料即可登入,出現這個介面表示登入成功