多线程抽取数据库数据

记录一次多线成抽取数据的方案

public void static main(String[] args){
    
    
	//每页大小
	int pageSize=100;
	
	//总记录数
	int totalCount=ProductDAO.countAll();
	
	//计算一共有多少页
	int totalPage=(totalCount+pageSize-1)/pageSize;

	int begin,end;
	for(int current=1;current<totalPage;current++){
    
    
	    begin=(current-1)*pageSize;
	    end=Math.min(begin+pageSize,totalCount);
       
        //模拟抽取数据
        select * from product limit begin,end;
	}
}