using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;
namespace DBFactory
{
    public class OleDBFactory:DBFactory 
    {
        OleDbConnection conn = new OleDbConnection();
        public override IDbConnection GetDBConnection()
        {
            return conn;
        }
        public override IDbTransaction GetDBTransaction(IsolationLevel LockAction)
        {

            return conn.BeginTransaction(LockAction);
        }
        public override IDbCommand GetDBCommand()
        {
            return new OleDbCommand();
        }
        public override IDbCommand GetDBCommand(string cmdText, IDbConnection conn1)
        {
            return new OleDbCommand(cmdText,(OleDbConnection) conn1);
        }
        public override IDbDataAdapter GetDataAdapter(IDbCommand dbc)
        {
            return new OleDbDataAdapter((OleDbCommand)dbc);
        }
        public override IDbDataAdapter GetDataAdapter()
        {
            return new OleDbDataAdapter();
        }
        public override IDbDataParameter GetParameter()
        {
            return new OleDbParameter();
        }
        public override IDbDataParameter GetParameter(string ParameterName, DbType dbtype)
        {
            return new OleDbParameter(ParameterName, (OleDbType)dbtype);
        }
        public override IDataReader GetDataReader(IDbCommand dbc)
        {
            return ((OleDbCommand)dbc).ExecuteReader(); ;
        }
    }
}
