2018-06-03 22:26:41 +08:00

32 lines
1.2 KiB
Plaintext

<%@page import="com.amarsoft.app.awe.config.InitDBType"%>
<%@page import="com.tenwa.comm.util.jboutil.DataOperatorUtil"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.amarsoft.are.jbo.JBOFactory"%>
<%@page import="com.amarsoft.are.jbo.JBOTransaction"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
String sql=CurPage.getParameter("sql");
String value=CurPage.getParameter("value");
String text=CurPage.getParameter("text");
JBOTransaction tx=JBOFactory.createJBOTransaction();
List<Map<String,String>> list=DataOperatorUtil.getDataBySql(tx, sql, null);
List<String>tempList=new ArrayList<String>();
for(int i=0;i<list.size();i++){
if("MYSQL".equals(InitDBType.DBTYPE)){
tempList.add("{'text':'"+list.get(i).get(text)+"','value':'"+list.get(i).get(value)+"'}");
}else if("ORACLE".equals(InitDBType.DBTYPE)){
tempList.add("{'text':'"+list.get(i).get(text.toUpperCase())+"','value':'"+list.get(i).get(value.toUpperCase())+"'}");
}
}
tx.commit();
out.println(tempList.toString());
%><%@ include file="/IncludeEndAJAX.jsp"%>