zoukankan      html  css  js  c++  java
  • 将导入的文件生成数据字典

    今天的工作是将导入的文件生成数据字典;

    导入的文件:

    public void Ttable( HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException {
    request.setCharacterEncoding("utf-8");
    response.setContentType("text/html;charset=UTF-8");
    System.out.println("连接了生成表格");
    /*
    PrintWriter out = response.getWriter();
    String json="{'code': 0,'msg':'','count':100,'data':[{'id':'1','username':'name','sex':'男'}]}";
    return json;

    */
    List<SqlTableBean> list=dao.getTableAll("firtable");
    JSONArray json=new JSONArray();
    for(int i=0;i<list.size();i++){
    JSONObject ob=new JSONObject();
    ob.put("ywname",list.get(i).getYwname());
    ob.put("zwname",list.get(i).getZwname());
    ob.put("danwei",list.get(i).getDanwei());
    ob.put("zdtype",list.get(i).getZdtype());
    ob.put("beizhu",list.get(i).getBeizhu());
    ob.put("ispri",list.get(i).getIspri());
    ob.put("chtime",list.get(i).getChtime());
    json.add(ob);
    }
    JSONObject ob=new JSONObject();
    ob.put("code", 0);
    ob.put("msg", "");
    ob.put("count",1);
    ob.put("data",json);
    PrintWriter out = response.getWriter();
    out.write(ob.toString());
    }
    这样就可以将导入的文件生成数据字典了
  • 相关阅读:
    redis搭建集群
    redis搭建主从
    redis与python交互
    redis数据操作篇
    redis配置篇
    node 淘宝镜像
    java 深copy
    springmvc配置访问静态文件
    centos 启动 oracle
    List 分隔多次执行 且在同一个事物当中
  • 原文地址:https://www.cnblogs.com/092e/p/15526146.html
Copyright © 2011-2022 走看看