NHibernate各种数据库连接参数文件配置方法说明
//NHibernate各种数据库连接参数文件配置方法说明
//配置文件Config/Hibernate.cfg.xml内容如下所示:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="CwfServer">
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
<property name="connection.connection_string">server=192.168.1.244;database=wf_db_t;uid=sa;pwd=supersit.1;</property>
<property name="adonet.batch_size">10</property>
<property name="show_sql">true</property>
<property name="command_timeout">60</property>
<property name="hbm2ddl.auto">update</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<!--<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>-->
<mapping assembly="Net.NHibernateDB"/>
<mapping assembly="Cwfapi"/>
<mapping assembly="CwfEngine"/>
</session-factory>
</hibernate-configuration>
其中:具体数据库需要修改的地方说明如下:
=========================================================================================
SQLServer配置方法:
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.driver_class">NHibernate.Driver.Sql2008ClientDriver</property>
------------------------------
<property name="dialect">NHibernate.Dialect.MsSql7Dialect</property>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
<property name="dialect">NHibernate.Dialect.MsSql2012Dialect</property>
------------------------------
<property name="connection.connection_string">server=192.168.1.244;database=wf_db_t;uid=sa;pwd=supersit.1;</property>
=========================================================================================
Oracle配置方法:
<property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
------------------------------
<property name="dialect">NHibernate.Dialect.Oracle8iDialect</property>
<property name="dialect">NHibernate.Dialect.Oracle9iDialect</property>
<property name="dialect">NHibernate.Dialect.OracleLiteDialect</property>
<property name="dialect">NHibernate.Dialect.Oracle10gDialect</property>
------------------------------
<property name="connection.connection_string">server=oracle244;uid=wf_db;pwd=1;</property>
=========================================================================================
MySQL配置方法:
<property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
------------------------------
<property name="dialect">NHibernate.Dialect.MySQLDialect</property>
<property name="dialect">NHibernate.Dialect.MySQL5Dialect</property>
------------------------------
<property name="connection.connection_string">server=192.168.1.244;database=wf_db;uid=wf_db;pwd=1;</property>
=========================================================================================
SQLite配置方法:
<property name="connection.driver_class">NHibernate.Driver.SQLiteDriver</property>
<property name="connection.driver_class">NHibernate.Driver.SQLite20Driver</property>
------------------------------
<property name="dialect">NHibernate.Dialect.SQLiteDialect</property>
------------------------------
<property name="connection.connection_string">Data Source=c:\wf_db.db3;Version=3;</property>
=========================================================================================
PostgreSQL配置方法:
<property name="connection.driver_class">NHibernate.Driver.NpgsqlDriver</property>
<property name="connection.driver_class">NHibernate.Driver.SQLite20Driver</property>
------------------------------
<property name="dialect">NHibernate.Dialect.PostgreSQLDialect</property>
------------------------------
<property name="connection.connection_string">server={0};database={1};uid={2};pwd={3};</property>
=========================================================================================
MDB Access配置方法:
<property name="connection.driver_class">NHibernate.Driver.OleDbDriver</property>
------------------------------
<property name="dialect">NHibernate.Dialect.GenericDialect</property>
------------------------------
<property name="connection.connection_string">Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};</property>
=========================================================================================
DB2配置方法:
<property name="connection.driver_class">NHibernate.Driver.DB2Driver</property>
<property name="connection.driver_class">NHibernate.Driver.DB2400Driver</property>
------------------------------
<property name="dialect">NHibernate.Dialect.DB2Dialect </property>
<property name="dialect">NHibernate.Dialect.DB2400Dialect </property>
------------------------------
<property name="connection.connection_string">UID=db2admin;PWD=1;Database=SAMPLE;Server=SHARK-LABTOP:50000
</property>
=========================================================================================
Informix配置方法:
<property name="connection.driver_class">NHibernate.Driver.IfxDriver</property>
------------------------------
<property name="dialect">NHibernate.Dialect.InformixDialect </property>
<property name="dialect">NHibernate.Dialect.InformixDialect0940</property>
<property name="dialect">NHibernate.Dialect.InformixDialect1000</property>
------------------------------
<property name="connection.connection_string">Host={0};Service={1};Server={2};Database={3};User id={4};Password={5};</property>
=========================================================================================
---the---end---
NHibernate各种数据库连接参数文件配置方法说明的更多相关文章
- Tomcat数据库连接池的配置方法总结
Tomcat数据库连接池的配置方法总结 数据库连接是一种关键的有限的昂贵的资源,这在多用户网页应用程序中体现的尤为突出.对数据库连接的管理能显著影响到整个应用程序的伸缩性和健壮性,影响到程序的性能指标 ...
- informatica 参数文件配置
Informatica 中 parameter file 参数文件配置规则: 参数文件的头部内容 [Global] All Integration Services, Integration Serv ...
- vim 参数文件配置
下面是我配置的遇到问题不能修改配置文件时的解决方案 1 /usr/share/vim/vimrc 2 这个是系统型的vimrc配置文件,为了保证vim的正常使用,一般并不会修改这个文件, 而是应该在你 ...
- stage_ros的world文件配置方法
官方文档参阅:http://rtv.github.io/Stage/modules.html stage_ros是一个基于stage的2D模拟器,用于ROS的仿真测试.虽然现在越来越多的人在使用gaz ...
- mysql中max_allowed_packet参数的配置方法(避免大数据写入或者更新失败)
修改方法 1.修改配置文件 可以编辑my.cnf来修改(windows下my.ini),在[mysqld]段或者mysql的server配置段进行修改. 代码如下: max_allowed_packe ...
- Spring property文件配置方法以及如何与工程分离
1,Spring使用property文件作为配置源 工程中难免出现一些需要每次部署都需要配置的参数,如数据源连接参数等,测试环境跟实际运行环境是不一样的. 使用spring框架的话,这些参 ...
- Linux操作系统下/etc/hosts文件配置方法
1.关于/etc/host,主机名和IP配置文件 Hosts - The static table lookup for host name(主机名查询静态表) hosts文件是Linux系统中一个负 ...
- iis中限制访问某个文件或某个类型的文件配置方法
Note:此处不是权限设置问题,此处不是权限设置问题,此处不是权限设置问题!只是出于数据或者网络安全,禁止扫描工具直接扫描到某些包含敏感信息的文件,尤其比如日志.配置等 默认ASP.NET已经考虑到了 ...
- Spring中注入List,Set,Map,Properties的xml文件配置方法
下面的例子展示了如何注入 List – <list/> Set – <set/> Map – <map/> Properties – <props/> ...
随机推荐
- 部署sharepointform验证
1 iis sharepoint v4 提供程序2 web service 验证提供程序3 创建web应用程序(选择基于身份验证模式,配置提供程序)4 创建网站集(空)5 创建网站集
- 改变VS2013的菜单栏字母为小写
REG ADD HKCU\Software\Microsoft\VisualStudio\12.0\General /v SuppressUppercaseConversion /t REG_DWOR ...
- C#中Func<T,TResult>的用法和Lambda表达式
在C#3.0中引用了Limbda表达式,Limbda表达式实际上就是一个方法,只不过该方法是匿名方法(即没有名称的方法)代码片段: Func<int,string,string> t=(i ...
- WinForm设置控件焦点(转)
http://blog.csdn.net/zlwzlwzlw/article/details/8573921 winform窗口打开后文本框的默认焦点设置,进入窗口后默认聚焦到某个文本框,两种方法: ...
- 已知要闪回的大致时间使用基于as of scn的闪回查询
基本判断出要恢复误操作的dml的时间可以使用如下的方法进行数据的恢复: example: 一.创建test表 -------create table flashback_asof------ crea ...
- Python网页信息采集:使用PhantomJS采集淘宝天猫商品内容
1,引言 最近一直在看Scrapy 爬虫框架,并尝试使用Scrapy框架写一个可以实现网页信息采集的简单的小程序.尝试过程中遇到了很多小问题,希望大家多多指教. 本文主要介绍如何使用Scrapy结合P ...
- python GUI学习——Tkinter
支持python的常见GUI工具包: Tkinter 使用Tk平台 很容易得到 半标准 wxpython 基于wxWindows.跨平台越来越流行 Python Win 只能在Windows上使用 使 ...
- The package does not support the device architecture (x86). You can change the supported architectures in the Android Build section of the Project Opt
The package does not support the device architecture (x86). You can change the supported architectur ...
- MYSQL 中的变量
1.用户自己定义变量 2.系统变量(全局变量,会话变量) ----------------------------------------------------------------------- ...
- 什么是Intent(意图)
1.Intent是一种运行时绑定(runtime bingding)机制,它能在程序运行的过程中连接两个不同的组件.通过Intent,你的程序可以向Android表达某种 请求或者意愿,Android ...