没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
// 获得表数据
/**
* @param typeClass
* @param db
* @return
* @throws ExceptionUtil
*/
public <T> ArrayList<T> getAllData(Class<T> typeClass,SQLiteDatabase db) throws ExceptionUtil {
ArrayList<T> beens = new ArrayList<T>();
if (beens != null) {
beens.clear();
}
Cursor cursor= getData(typeClass,db);
int columnCount=cursor.getColumnCount();
Log.e(TAG, "count:"+columnCount);
String[] columnName =new String [columnCount];
for(int i=0;i<columnName.length-1;i++){
columnName[i]=cursor.getColumnName(i+1).toString();
System.out.println(columnName[i]);
}
try {
Field[] fields= typeClass.getDeclaredFields();
cursor.moveToFirst();
int i=0;
while (cursor.moveToNext()) {
T obj;
i++;
obj = typeClass.newInstance();
for(int j=0;j<fields.length;j++){
/**
* @param typeClass
* @param db
* @return
* @throws ExceptionUtil
*/
public <T> ArrayList<T> getAllData(Class<T> typeClass,SQLiteDatabase db) throws ExceptionUtil {
ArrayList<T> beens = new ArrayList<T>();
if (beens != null) {
beens.clear();
}
Cursor cursor= getData(typeClass,db);
int columnCount=cursor.getColumnCount();
Log.e(TAG, "count:"+columnCount);
String[] columnName =new String [columnCount];
for(int i=0;i<columnName.length-1;i++){
columnName[i]=cursor.getColumnName(i+1).toString();
System.out.println(columnName[i]);
}
try {
Field[] fields= typeClass.getDeclaredFields();
cursor.moveToFirst();
int i=0;
while (cursor.moveToNext()) {
T obj;
i++;
obj = typeClass.newInstance();
for(int j=0;j<fields.length;j++){
资源评论
yuanxiaodon
- 粉丝: 0
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Windows系统下安装与配置Neo4j的步骤
- 基于matlab实现潮流计算和最优潮流计算的程序1,对毕业设计有一定用处.rar
- 基于大数据学习资源推荐系统的设计与实现(部署视频)-kaic.mp4
- 哈工大形式语言和自动机2022期末含答案
- Windows系统下安装与配置Neo4j的步骤
- 哈希算法(Hash Algorithm)是一种将任意长度的二进制数据映射为较短的、固定长度的二进制值的函数.txt
- Windows系统下安装与配置Neo4j的步骤
- 在二叉树或更复杂的树形结构中,先序输出叶结点.txt
- 列出所有祖先结点的概念通常与树形结构或图论中的节点相关.txt
- 基于matlab实现潮流计算程序,MATLAB潮流计算程序.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功