public AbstractDBProvider(IntegrationAdapter pAdapterMetadata, ApplicationDatabas pApplicationDatabaseMetadata, IAppRuntime pAppRuntime) : base(pAdapterMetadata, pAppRuntime) { this.ApplicationDatabaseMetadata = pApplicationDatabaseMetadata; if (this.ApplicationDatabaseMetadata != null) { this.ProviderType = this.ApplicationDatabaseMetadata.ApplicationDatabaseType.ToEnum <ApplicationDatabaseType>(); } }
/// <summary> /// Get Application Database /// </summary> /// <param name="pApplicationDatabaseID"></param> /// <returns></returns> public ApplicationDatabas GetApplicationDatabase(int pApplicationDatabaseID) { ApplicationDatabas entity = null; try { entity = base.AppRuntime.DataService.GetEntity(GetDataRequest <ApplicationDatabas> .Create(c => c.ApplicationDatabaseID == pApplicationDatabaseID)); } catch (Exception ex) { LogManager.LogException(ex); } return(entity); }
/// <summary> /// Create DBProvider /// </summary> /// <param name="pAdapterMetadata"></param> /// <param name="pApplicationDatabase"></param> /// <param name="pAppRuntime"></param> /// <returns></returns> public static AbstractDBProvider CreateDBProvider(IntegrationAdapter pAdapterMetadata, ApplicationDatabas pApplicationDatabase, IAppRuntime pAppRuntime) { AbstractDBProvider dbProvider = null; try { switch (pApplicationDatabase.ApplicationDatabaseType.ToEnum <ApplicationDatabaseType>()) { case ApplicationDatabaseType.SQLServer: { dbProvider = SQLProvider.Create(pAdapterMetadata, pApplicationDatabase, pAppRuntime); } break; case ApplicationDatabaseType.Oracle: { dbProvider = OracleProvider.Create(pAdapterMetadata, pApplicationDatabase, pAppRuntime); } break; case ApplicationDatabaseType.MySQL: { //Not yet Implemented } break; case ApplicationDatabaseType.Sybase: { //Not yet Implemented } break; default: { } break; } } catch { throw; } return(dbProvider); }
public OracleProvider(IntegrationAdapter pAdapterMetadata, ApplicationDatabas pApplicationDatabaseMetadata, IAppRuntime pAppRuntime) : base(pAdapterMetadata, pApplicationDatabaseMetadata, pAppRuntime) { }
/// <summary> /// Create /// </summary> /// <param name="pApplicationDatabaseMetadata"></param> /// <param name="pAppRuntime"></param> /// <returns></returns> internal static OracleProvider Create(IntegrationAdapter pAdapterMetadata, ApplicationDatabas pApplicationDatabaseMetadata, IAppRuntime pAppRuntime) { return(new OracleProvider(pAdapterMetadata, pApplicationDatabaseMetadata, pAppRuntime)); }