/* |-------------------------------------------------------------------------------| | Copyright © Computer Ease Limited | | Address: 1/9 Bloack-A Lalmatia, Dhaka-1207, Bangladesh | | Email: info@celimited.com, cease@bol-online.com, web: www.celimited.com | | Unauthorized copy or distribution is strictly prohibited | | Author: S. M. Russel, Last modified date: 17/04/2009 | |-------------------------------------------------------------------------------| */ using System; using System.Data; using System.Collections; using System.Configuration; using Ease.Core.Utility; using System.Data.OracleClient; namespace Ease.Core.DataAccess.Oracle { #region DataAccess: Oracle Connection Factory public sealed class OracleFactory : ConnectionFactory { /// /// Create an instance of IDbConnection for oracle using default connectionstring. /// /// Retuen an instance of OracleConnection. public override System.Data.IDbConnection CreateConnection() { return new OracleConnection(base.ConnectionNode.ConnectionString); } /// /// Create an instance of IDbConnection for oracle using ConnectionContext. /// /// Valid ConnectionContext. /// Return instatnce of OracleConnection. public override System.Data.IDbConnection CreateConnection(ConnectionContext context) { if (context == null || context.ContextKey.Length <= 0) throw new Exception("There is no key in the Connection Context"); return new OracleConnection(ConnectionFactory.ContextConnection(context).ConnectionNode.ConnectionString); } internal OracleFactory() { } } #endregion }