To change which database is being targeted, the web.config file must be edited, and at a minimum there are three options which must be changed to support each database engine - as per the table below:
Database Product | Migrator Provider | NHibernate Driver | NHibernate Dialect |
---|---|---|---|
MySQL | Migrator.Providers.Mysql.MysqlDialect | NHibernate.Driver.MySqlDataDriver | EnterpriseTester.Core.Dialects.MySqlDialectEx, EnterpriseTester.Core |
Oracle 10g/11g (Unmanaged Driver) | Migrator.Providers.Oracle.OracleDialect | NHibernate.Driver.OracleDataClientDriver | NHibernate.Dialect.Oracle10gDialect |
Oracle 10g/11g (Managed Driver) | Migrator.Providers.Oracle.OracleManagedDriverDialect | EnterpriseTester.Core.Dialects.OracleManagedDataClientDriver, EnterpriseTester.Common | NHibernate.Dialect.Oracle10gDialect |
PostgreSQL | Migrator.Providers.PostgreSQL.PostgreSQL82Dialect | NHibernate.Driver.NpgsqlDriver | NHibernate.Dialect.PostgreSQL82Dialect |
SQLServer 2005 (and above) | Migrator.Providers.SqlServer.SqlServer2005Dialect | NHibernate.Driver.SqlClientDriver | NHibernate.Dialect.MsSql2005Dialect |
Info | ||
---|---|---|
| ||
When using the Oracle managed driver, you will also need to configure the following in the appsettings section of your web.config file: <appsettings> <add key="nhibernate.driver.oracle.enable-multiquery" value="true" /> ... <\appsettings> |
...
Each database also uses a slightly different connection string format - the http://connectionstrings.com/ website provides useful details of each connection string format.
Database Product | Example Connection String |
---|---|
Oracle | UserID=SYSTEM;Password=password;Data Source=192.168.1.232:1521/orcl |
PostgreSQL | Host=192.168.1.232;Port=5432;Database=etest;UserId=postgres;Password=Password123;Timeout=60;CommandTimeout=120; |
SQL Server Express (user-attached database) | DataSource=.\SQLExpress;AttachDbFilename=C:\ProgramFiles(x86)\CatchLimited\EnterpriseTests\Data\EnterpriseTester.mdf;InitialCatalog=EnterpriseTester;Trusted_Connection=Yes; |
SQL Server (Integrated Security) | DataSource=.\SQLExpress;Initial Catalog=EnterpriseTester;IntegratedSecurity=True; |
SQL Server (SQL username/password) | DataSource=dbserver;Initial Catalog=EnterpriseTester;UserId=etuser;Password=etpass; |
Info | ||
---|---|---|
| ||
Before beginning, make sure you have a version of PostgreSQL that supports a column type of "uuid" (normally version 8.3 and later) as this is required by Enterprise Tester. |