public void InstallMSSQLDatabase() { IDbProvider dbProvider = DbProviderFactory.GetDbProvider("SqlServer-2.0"); AdoTemplate ado = new AdoTemplate(dbProvider); // (re-)create database(s) dbProvider.ConnectionString = DBConnection.Replace("$DATABASE$", "master"); SimpleAdoTestUtils.ExecuteSqlScript(ado, GetResource(this, "RecreateDatabases.sql")); // create tables dbProvider.ConnectionString = DBConnection.Replace("$DATABASE$", "Spring"); SimpleAdoTestUtils.ExecuteSqlScript(ado, GetResource(this, "Data.NHibernate/creditdebit.sql")); SimpleAdoTestUtils.ExecuteSqlScript(ado, GetResource(this, "Data.NHibernate/testObject.sql")); }
/// <summary> /// Execute the given SQL script using /// <see cref="SimpleAdoTestUtils.ExecuteSqlScript(Spring.Data.IAdoOperations,Spring.Core.IO.IResourceLoader,string,bool,System.Text.RegularExpressions.Regex[])"/> /// </summary> /// <param name="scriptResourcePath"></param> /// <param name="continueOnError"></param> protected void ExecuteSqlScript(string scriptResourcePath, bool continueOnError) { SimpleAdoTestUtils.ExecuteSqlScript(this.AdoTemplate, this.applicationContext, scriptResourcePath, continueOnError); }