zoukankan      html  css  js  c++  java
  • mysql 系统表的作用



    mysql 的系统表记录了所有数据库表(包括视图的定义语句)的字段列,顺序,类型等等,知道这些的话可以做些抽取模板淫荡的操作吧 嘿嘿 


    1. public void shuaxinglb() {
    2. try {
    3. PrintWriter out = ServletActionContext.getResponse().getWriter();
    4. eqmsService.saveOrupdateBySql("delete from glb", null);
    5. List<User> users = eqmsService.findAll("from User", null);
    6. eqmsService
    7. .saveOrupdateBySql(
    8. "INSERT INTO `glb` (`biaoming`, `lieming`, `leixing`, `zwm`,`shunxu`,`display`) select TABLE_NAME,COLUMN_NAME,data_type ,COLUMN_COMMENT,ordinal_position,1 from information_schema.columns where table_schema='tzerp_db';",
    9. null);
    10. for (User user : users) {
    11. eqmsService
    12. .saveOrupdateBySql(
    13. "INSERT INTO `user_glb` (user_id,`biaoming`, `lieming`, `leixing`,`zwm`,`shunxu`,`display`) select ?,`biaoming`, `lieming`, `leixing`, `zwm`,`shunxu`,`display` from glb g where lieming not in(select lieming from user_glb where biaoming=g.biaoming and user_id=? );",
    14. new Object[] { user.getUserId(), user.getUserId()});
    15. }
    16. eqmsService.saveOrupdateBySql("delete from user_glb where user_glb.lieming not in(select glb.lieming from glb where glb.biaoming=user_glb.biaoming);", null);
    17. eqmsService.saveOrupdateBySql(
    18. "update user_glb set zwm=lieming where zwm ='';", null);
    19. out.print("aaa");
    20. } catch (IOException e) {
    21. // TODO Auto-generated catch block
    22. e.printStackTrace();
    23. }
    24. }

  • 相关阅读:
    python常用模块②
    python常用模块①
    面向对象相关部分双下划线方法补充
    面向对象进阶 上
    面向对象初识④
    面向对象初识③
    综合架构-负载均衡
    wecent 搭建
    综合架构--存储
    综合架构--备份
  • 原文地址:https://www.cnblogs.com/signheart/p/6595277.html
Copyright © 2011-2022 走看看