Beispiel #1
0
        static void Main(string[] args)
        {
            //使用MSSQL連線
            DBConnectFactory factory   = new DBConnectFactory();
            IDBConnection    mssqlConn = factory.GetConnection(ConnectionEnum.MSSQL);

            mssqlConn.DoConnect();

            //使用Oracle連線
            IDBConnection oracleConn = factory.GetConnection(ConnectionEnum.Oracle);

            oracleConn.DoConnect();

            Console.ReadLine();
        }
Beispiel #2
0
 public DbService(DBConnectFactory dBConnectFactory)
 {
     this.dBConnectFactory = dBConnectFactory;
 }