package cn.pdsu;

import java.util.LinkedList;
import java.util.List;
import cn.pdsu.Student;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import cn.pdsu.Student;
/**
 * 类说明:数据的封装
 * 
 * @author 作者: LiuJunGuang
 * @version 创建时间:2011-11-9 下午02:28:27
 */
public class DataSourceDAO {
	private  List<Student> list = new LinkedList<Student>();//
	private  Connection con;
	
	
	 
		//for (int i = 0; i < 20; i++) {
			//list.add(new Student(i, "王二" + i, "男", "学生" + i));
	//}
	
    
	/**
	 * 模拟数据库中分页查询
	 * 
	 * @param startIndex
	 *            要查询的开始索引
	 * @param count
	 *            查询的总记录数
	 * @return 查询出的学生记录
	 */
	public List<Student> findStudent(int startIndex, int count) {
		Student student=new Student();
		list = student.getAllStudents();
		int num = count + startIndex;
		if (num > list.size())
			num = list.size();
		return list.subList(startIndex, num);
	}

	/**
	 * 模拟数据库中查询总记录数
	 * 
	 * @return 总的记录数
	 */
	public int count() {
		Student student=new Student();
		list=student.getAllStudents();
		return list.size();
	}
	
	
	
}
最近下载更多
asddwh  LV12 2023年12月29日
wuge123  LV8 2023年6月12日
1719863922  LV11 2022年6月17日
刚刚vv谭v  LV4 2022年1月4日
微信网友_5768552477921280  LV6 2022年1月2日
17771013609  LV4 2021年12月31日
fesdfs  LV1 2021年12月20日
3089559272  LV11 2021年12月17日
龙门客栈  LV9 2021年12月16日
 LV5 2021年12月15日
最近浏览更多
沈从文  LV2 2023年12月31日
asddwh  LV12 2023年12月25日
wodewode  LV1 2023年12月23日
微信网友_6786215447367680  LV4 2023年12月23日
好哇好哇还是 2023年12月20日
暂无贡献等级
颜菜菜  LV2 2023年12月19日
fff2003  LV6 2023年11月20日
sunshine9920  LV12 2023年11月7日
卢本伟不开挂  LV4 2023年10月22日
zdfxcv  LV1 2023年10月14日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友