diff --git a/src/weaver/interfaces/hzzx/cominfo/PropBean.java b/src/weaver/interfaces/hzzx/cominfo/PropBean.java new file mode 100644 index 0000000..18ffb4d --- /dev/null +++ b/src/weaver/interfaces/hzzx/cominfo/PropBean.java @@ -0,0 +1,73 @@ +package weaver.interfaces.hzzx.cominfo; + +import org.apache.commons.lang.StringUtils; +import weaver.conn.RecordSet; +import weaver.general.BaseBean; +import weaver.general.Util; + +public class PropBean { + + public static BaseBean bb = new BaseBean(); + public static String active = Util.null2String(bb.getPropValue("developProp","active")).toUpperCase(); + + /*** + * + * @param pkey + * @return + */ + public static String getUfPropValue(String pkey) + { + BaseBean baseBean = new BaseBean(); + if(StringUtils.isEmpty(pkey)){ + return ""; + } + + if(StringUtils.isEmpty(active)){ + active = Util.null2String(baseBean.getPropValue("developProp","active")).toUpperCase(); + } + + String pvalue = ""; + try{ + RecordSet rs = new RecordSet(); + String sql = " SELECT DEVVALUE,TESTVALUE,PRODVALUE FROM UF_PROP WHERE PKEY = ?"; + rs.executeQuery(sql,new Object[]{pkey.trim()}); + if(rs.next()){ + pvalue = Util.null2String(rs.getString(active+"VALUE")); + } + }catch (Exception e){ + e.printStackTrace(); + bb.writeLog("propbean-e:"+e); + } + return pvalue; + } + + + /*** + * + * @param pkey + * @return + */ + public String getUfPropValueStatic(String pkey) + { + BaseBean baseBean = new BaseBean(); + if(StringUtils.isEmpty(pkey)){ + return ""; + } + String active = Util.null2String(baseBean.getPropValue("developProp","active")).toUpperCase(); + String pvalue = ""; + try{ + RecordSet rs = new RecordSet(); + String sql = " SELECT DEVVALUE,TESTVALUE,PRODVALUE FROM UF_PROP WHERE PKEY = ?"; + rs.executeQuery(sql,new Object[]{pkey.trim()}); + if(rs.next()){ + pvalue = Util.null2String(rs.getString(active+"VALUE")); + } + baseBean.writeLog("pvalue:"+pvalue); + }catch (Exception e){ + e.printStackTrace(); + bb.writeLog("propbean-e:"+e); + } + return pvalue; + } + +}