zoukankan      html  css  js  c++  java
  • 查询数据,更新数据

    查询、更新

    public static Map<Integer,String> getPageData(int pageNum,int pageSize) throws Exception
        {
            Map<Integer,String> list1 = new HashMap<Integer,String>();
            String sql1 = "select id,news_link from data_2019102101_zgcxhzfjsb limit "+pageNum+", "+pageSize+"";
            System.out.println(sql1);
            PreparedStatement ps = commonConn.prepareStatement(sql1);
            
            ResultSet rs = ps.executeQuery();
            // 输出查询结果
            while(rs.next()){
                int id1 = rs.getInt("id");
                String news_link = rs.getString("news_link");
                list1.put(id1, news_link);
            }
            
            
            return list1;
        }
        
        
        public static void updateContext(int id1,String context1) throws Exception
        {
            String sql1 = "update data_2019102101_zgcxhzfjsb set news_context = '"+context1+"' where id= "+id1;
            System.out.println(sql1);
            PreparedStatement ps = commonConn.prepareStatement(sql1);
            int rs1 = ps.executeUpdate();
            ps.close();
        }
  • 相关阅读:
    网站图片轮播效果
    图片处理类
    字符串处理帮助类
    css3高级选择器
    JQuery选择器大全
    ASCII码表
    jQuery选择器大全
    OpenFileDialog无法弹出的解决方法
    socket学习目录
    ps-抠图
  • 原文地址:https://www.cnblogs.com/herd/p/11716521.html
Copyright © 2011-2022 走看看