Exemplo n.º 1
0
        /// <summary>
        /// 測試連接Oracle資料庫
        /// </summary>
        public static void TestYuantaOracle()
        {
            OracleDataBase        db  = new OracleDataBase("User Id=bpi;Password=yuantacps;Data Source=TS03");
            PTTradingUnitOperator opr = new PTTradingUnitOperator(db);

            //int totalRecords = opr.Select(null);
            //foreach (PTTradingUnitRecord record in opr.RecordList)
            //{
            //    Console.WriteLine( record.PTCorpID + "," + record.PTCostCenter + "," + record.PTCustID + "," + record.PTDeptID +
            //        "," + record.PTTradeGoal + "," + record.PTUserID );
            //}

            foreach (PTTradingUnitRecord record in opr.SelectIterator(null))
            {
                Console.WriteLine(record.PTCorpID + "," + record.PTCostCenter + "," + record.PTCustID + "," + record.PTDeptID +
                                  "," + record.PTTradeGoal + "," + record.PTUserID);
            }

            string[] corpID = opr.SelectFields <string>("ptCorpID", false, 10, null, AbstractOperator <PTTradingUnitRecord> .ConvertFirstColumn <string>);
            foreach (string cid in corpID)
            {
                Console.WriteLine(cid);
            }

            int totalCount = opr.SelectCount(null);

            Console.WriteLine("TotalCount " + totalCount);

            db.Close();
        }
Exemplo n.º 2
0
        protected static void OracelAccessThread()
        {
            PTTradingUnitOperator opr = new PTTradingUnitOperator(conDB);
            int counter = 100;

            while (counter-- > 0)
            {
                int totalRecords = opr.Select(null);
                Console.WriteLine(Thread.CurrentThread.ManagedThreadId.ToString() + "," + opr.RecordList.Count);
            }
        }