Home >Database >Mysql Tutorial >NHibernate各种数据库连接参数文件配置方法说明

NHibernate各种数据库连接参数文件配置方法说明

WBOY
WBOYOriginal
2016-06-07 15:55:171261browse

//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=c

//NHibernate各种数据库连接参数文件配置方法说明

//配置文件Config/Hibernate.cfg.xml内容如下所示:



NHibernate.Driver.SqlClientDriver
NHibernate.Dialect.MsSql2008Dialect
server=192.168.1.244;database=wf_db_t;uid=sa;pwd=supersit.1;
10
true
60
update
true 1, false 0, yes 'Y', no 'N'






其中:具体数据库需要修改的地方说明如下:
=========================================================================================
SQLServer配置方法:
NHibernate.Driver.SqlClientDriver
NHibernate.Driver.Sql2008ClientDriver
------------------------------
NHibernate.Dialect.MsSql7Dialect
NHibernate.Dialect.MsSql2000Dialect
NHibernate.Dialect.MsSql2005Dialect
NHibernate.Dialect.MsSql2008Dialect
NHibernate.Dialect.MsSql2012Dialect
------------------------------
server=192.168.1.244;database=wf_db_t;uid=sa;pwd=supersit.1;
=========================================================================================

Oracle配置方法:
NHibernate.Driver.OracleClientDriver
------------------------------
NHibernate.Dialect.Oracle8iDialect
NHibernate.Dialect.Oracle9iDialect
NHibernate.Dialect.OracleLiteDialect
NHibernate.Dialect.Oracle10gDialect
------------------------------
server=oracle244;uid=wf_db;pwd=1;
=========================================================================================

MySQL配置方法:
NHibernate.Driver.MySqlDataDriver
------------------------------
NHibernate.Dialect.MySQLDialect
NHibernate.Dialect.MySQL5Dialect
------------------------------
server=192.168.1.244;database=wf_db;uid=wf_db;pwd=1;
=========================================================================================

SQLite配置方法:
NHibernate.Driver.SQLiteDriver
NHibernate.Driver.SQLite20Driver
------------------------------
NHibernate.Dialect.SQLiteDialect
------------------------------
Data Source=c:\wf_db.db3;Version=3;
=========================================================================================

PostgreSQL配置方法:
NHibernate.Driver.NpgsqlDriver
NHibernate.Driver.SQLite20Driver
------------------------------
NHibernate.Dialect.PostgreSQLDialect
------------------------------
server={0};database={1};uid={2};pwd={3};
=========================================================================================

MDB Access配置方法:
NHibernate.Driver.OleDbDriver
------------------------------
NHibernate.Dialect.GenericDialect
------------------------------
Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};
=========================================================================================

DB2配置方法:
NHibernate.Driver.DB2Driver
NHibernate.Driver.DB2400Driver
------------------------------
NHibernate.Dialect.DB2Dialect
NHibernate.Dialect.DB2400Dialect
------------------------------
UID=db2admin;PWD=1;Database=SAMPLE;Server=SHARK-LABTOP:50000

=========================================================================================

Informix配置方法:
NHibernate.Driver.IfxDriver
------------------------------
NHibernate.Dialect.InformixDialect
NHibernate.Dialect.InformixDialect0940
NHibernate.Dialect.InformixDialect1000
------------------------------
Host={0};Service={1};Server={2};Database={3};User id={4};Password={5};
=========================================================================================
---the---end---

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn