public static IDatabase GetDatabase(EnumDatabaseType sTypeConnection, string sConnectionString) { IDatabase oReturnDatabase = null; switch (sTypeConnection) { case EnumDatabaseType.SqlServer: oReturnDatabase = new DatabaseSqlServer(sConnectionString); break; case EnumDatabaseType.Oracle: oReturnDatabase = new DatabaseOracle(sConnectionString); break; case EnumDatabaseType.MySQL: oReturnDatabase = new DatabaseMySQL(sConnectionString); break; case EnumDatabaseType.SQLite: oReturnDatabase = new DatabaseSQLite(sConnectionString); break; default: oReturnDatabase = null; break; } return(oReturnDatabase); }
public static IDatabase getDatabaseHelper(String databaseType , AdoTemplate template , string connectionString , String databaseName , string projectNamespace , string projectFolder , bool semaIsminiSorgulardaKullan , bool semaIsminiDizinlerdeKullan , bool dboSemaTablolariniAtla , bool sysTablolariniAtla ) { IDatabase helper = null; switch (databaseType) { case DatabaseType.SqlServer: helper = new DatabaseSqlServer(template, connectionString, databaseName, projectNamespace, projectFolder, "System.Data.SqlClient", semaIsminiSorgulardaKullan, semaIsminiDizinlerdeKullan, sysTablolariniAtla, null); break; case DatabaseType.Oracle: helper = new DatabaseOracle(template, connectionString, databaseName, projectNamespace, projectFolder, "System.Data.OracleClient", semaIsminiSorgulardaKullan, semaIsminiDizinlerdeKullan, sysTablolariniAtla, null); break; case DatabaseType.Sqlite: helper = new DatabaseSqlite(template, connectionString, databaseName, projectNamespace, projectFolder, "System.Data.SQLite", semaIsminiSorgulardaKullan, semaIsminiDizinlerdeKullan, sysTablolariniAtla, null); break; } return(helper); }
private void testOracle(string connectionString, string databaseName) { Assembly oracleAssembly = Assembly.LoadWithPartialName("System.Data.OracleClient"); Object objReflection = Activator.CreateInstance(oracleAssembly.FullName, "System.Data.OracleClient.OracleConnection"); if (objReflection != null && objReflection is ObjectHandle) { ObjectHandle handle = (ObjectHandle)objReflection; Object objConnection = handle.Unwrap(); connection = (DbConnection)objConnection; connection.ConnectionString = connectionString; connection.Open(); connection.Close(); template = new AdoTemplate(); template.Connection = connection; template.DbProviderName = "System.Data.OracleClient"; DatabaseHelper = new DatabaseOracle(template); } }
private static void OracleTestHrGenerateOneSequence() { AdoTemplate template = CodeGenerationTestUtils.getTemplate("System.Data.OracleClient", "System.Data.OracleClient.OracleConnection", _OracleExampleConnectionString); IDatabase database = new DatabaseOracle(template); database.CodeGenerationDirectory = @"P:\github\Karkas.Ornek.OracleOrnek.Hr"; database.ConnectionDatabaseType = "Oracle"; database.ConnectionName = "Karkas.Ornek.OracleOrnek.Hr"; database.ConnectionString = _OracleExampleConnectionString; database.DatabaseNameLogical = "OracleDevelopmentHr"; database.DatabaseNamePhysical = "orcl"; database.ConnectionDbProviderName = "System.Data.OracleClient"; database.IgnoredSchemaList = ""; database.IgnoreSystemTables = true; database.ProjectNameSpace = "Karkas.Ornek.OracleOrnek.Hr"; database.StoredProcedureCodeGenerate = false; database.UseSchemaNameInFolders = false; database.UseSchemaNameInSqlQueries = false; database.ViewCodeGenerate = false; database.CodeGenerateOneSequence("DEPARTMENTS_SEQ", "HR"); }