|
private static final String DATASOURCE_TAKEOUT = "x5";
public static JSONObject getOrderCount(JSONObject params, ActionContext context) throws SQLException, NamingException {
Connection conn = context.getConnection(DATASOURCE_TAKEOUT);
try{
String sql = "SELECT COUNT(ord.fID) AS orderCount "
+ " FROM takeout_order ord ";
JSONObject ret = new JSONObject();
int count = Integer.parseInt(DataUtils.getValueBySQL(conn, sql, null).toString());
ret.put("orderCount", count);
return ret;
} finally {
conn.close();
}
}
上面是后端java后端的服务代码,请问前端调用,怎么取ret的值? |
|