Beispiel #1
0
        public OrlDb(OrlProvider provider, IDbConnection cn)
        {
            this.provider   = provider;
            this.connection = cn;

            factory = DbProviderFactories.GetFactory(orlProvider);
        }
        public OrlDbAdapter(OrlProvider provider, IDbConnection cn)
			: base(provider, cn)
		{}
        private void InitalProvider(IDBNode idbNode, ActionEnum actionEnum, ref IProvider tempProvider)
        {
            string connectString = string.Empty;

            CustomDBProxyConfigManagement customDBProxyConfigManagement = new CustomDBProxyConfigManagement(idbNode.Name, idbNode.GroupType);

            switch (customDBProxyConfigManagement.CurrentDBGroup.GroupTypeEnum)
            {
                case GroupTypeEnum.MSSQLServer:
                    connectString = customDBProxyConfigManagement.GetMSSQLServerConnectionString(actionEnum, idbNode.Name);
                    tempProvider = new SqlProvider(connectString);
                    break;
                case GroupTypeEnum.OracleServer:
                    connectString = customDBProxyConfigManagement.GetOracleServerConnectionString(actionEnum, idbNode.Name);
                    tempProvider = new OrlProvider(connectString);
                    break;
            }
        }
Beispiel #4
0
 public OrlDbAdapter(OrlProvider provider, IDbConnection cn)
     : base(provider, cn)
 {
 }
        public IDb GetDb(string sqlConnectionString,GroupTypeEnum groupTypeEnum=GroupTypeEnum.MSSQLServer)
        {
            IProvider sqlProvider=null;

            switch (groupTypeEnum)
            {
                case GroupTypeEnum.MSSQLServer:
                    sqlProvider = new SqlProvider(sqlConnectionString);
                    break;
                case GroupTypeEnum.OracleServer:
                    sqlProvider = new OrlProvider(sqlConnectionString);
                    break;
                case GroupTypeEnum.LiteSQLServer:
                    sqlProvider = new LitProvider(sqlConnectionString);
                    break;
            }
            
            return sqlProvider.OpenDb();
        }