Ejemplo n.º 1
0
        public static IDbDriver CreateDbDriver(string dbType)
        {
            IDbDriver driver = null;

            switch (dbType.ToLower())
            {
            case "sqlserver":
                driver = new SqlDbDriver();
                break;

            case "mysql":
                driver = new MySqlDriver();
                break;

            case "oracle":
                driver = new OracleDriver();
                break;

            case "sqlite":
                driver = new SQLiteDriver();
                break;

            case "access":
                driver = new OleDbDriver();
                break;
            }

            return(driver);
        }
Ejemplo n.º 2
0
 /// 构造函数
 public OracleRunner()
 {
     //
     // TODO: 在此处添加构造函数逻辑
     //
     driver = new OracleDriver();
 }
Ejemplo n.º 3
0
        public static string ToCreateTableScript(DbDriverType dbType, TableSchema tableSchema)
        {
            string result = "";

            if (dbType == DbDriverType.Mysql)
            {
                result = new MySqlDriver(null, "", "").ToCreateTableScript(tableSchema);
            }
            else if (dbType == DbDriverType.Oracle)
            {
                result = new OracleDriver(null, "", "").ToCreateTableScript(tableSchema);
            }
            else if (dbType == DbDriverType.Sqlite)
            {
                result = new SqliteDriver(null, "", "").ToCreateTableScript(tableSchema);
            }
            else
            {
                result = new SqlServer2000Driver(null, "", "").ToCreateTableScript(tableSchema);
            }

            return(result);
        }