示例#1
0
        /// <summary>
        ///   テーブルを削除するSQL文を作る
        /// </summary>
        public string GenerateDropper(DBCon.Type dbtype = DBCon.Type.Invalid)
        {
#if USE_MYSQL
            if (dbtype == DBCon.Type.Invalid)
            {
                dbtype = DBCon.Type.MySQL;
            }
#endif
#if USE_POSTGRESQL
            if (dbtype == DBCon.Type.Invalid)
            {
                dbtype = DBCon.Type.PostgreSQL;
            }
#endif
            switch (dbtype)
            {
#if USE_MYSQL
            case DBCon.Type.MySQL:
                return(GenerateDropperMySQL());
#endif
#if USE_POSTGRESQL
            case DBCon.Type.PostgreSQL:
                return(GenerateDropperPostgreSQL());
#endif
            default:
                throw new ArgumentException("Unsupported DB type");
            }
        }
示例#2
0
 /// <summary>
 ///   DB接続プールを用意する
 /// </summary>
 /// <remarks>
 ///   <para>
 ///     DBとの接続は必要になるまで行なわれません。
 ///   </para>
 /// </remarks>
 public DBConPool(int initsize, int maxsize, DBCon.Type dbtype, string server, string dbname, string user, string passwd)
 {
     init(initsize, maxsize);
     DBType = dbtype;
     Server = server;
     DBName = dbname;
     User   = user;
     Passwd = passwd;
 }