Beispiel #1
0
        public virtual String execute()
        {
            try
            {
                //读取配置
                DataBaseConfig config   = Config.getConfig.dataBaseConfig[getDataBaseName()];
                Identity       identity = config[getDataBaseIdentity()];

                //获取数据库控制器
                DataBaseClient db = DataBaseManger.getDataClient(identity);

                //语句
                String sql = getSql();

                //数据表
                DataTable table = db.QueryForTable(sql);

                //装配
                return(getWebServiceDataXML(table));
            }
            catch (Exception e)
            {
                return(getErrorWebServiceDataXML(e.Message));
            }
        }
Beispiel #2
0
        public DataTable executeForDataTable()
        {
            try
            {
                //读取配置
                DataBaseConfig config   = Config.getConfig.dataBaseConfig[getDataBaseName()];
                Identity       identity = config[getDataBaseIdentity()];

                //获取数据库控制器
                DataBaseClient db = DataBaseManger.getDataClient(identity);

                //语句
                String sql = getSql();

                //返回数据表
                return(db.QueryForTable(sql));
            }
            catch (Exception)
            {
                //异常返回null
                return(null);
            }
        }