草庐IT

database-cursor

全部标签

android - 有人可以解释一下 android 中的 Cursor 吗?

有人能解释一下光标的具体工作原理吗?或者下面部分代码的流程?我知道这是子Activity,但我不明白Cursor是如何工作的。finalUridata=Uri.parse("content://contacts/people/");finalCursorc=managedQuery(data,null,null,null,null);String[]from=newString[]{People.NAME};int[]to=newint[]{R.id.itemTextView};SimpleCursorAdapteradapter=newSimpleCursorAdapter(this

android - 滚动基于 Cursor 的适配器的大列表比内存中适配器的小列表快得多

我有一个Android应用,它既有基于CursorAdapter的ListView(由sqlite支持),也有基于自定义BaseAdapter的ListView是根据从服务器下拉的JSON动态构建的。两者显示的数据是相同的-一个图像和几个TextView。我的基于Cursor的ListView有3000行,基于JSON的ListView大约有30行。但是,对于基于Cursor的适配器,向下滚动列表的速度要快得多。对于基于JSON的列表,数据是在行可见之前全部获取的。两种类型列表的图像均按需下载。我将两个ListView配置相同-都将fastScrollEnabled、scrolling

[MySQL]数据库原理2,Server,DataBase,Connection,latin1、UTF-8,gb2312,Encoding,Default Collation——喵喵期末不挂科

希望你开心,希望你健康,希望你幸福,希望你点赞!最后的最后,关注喵,关注喵,关注喵,佬佬会看到更多有趣的博客哦!!!喵喵喵,你对我真的很重要!目录前言认识字符集和校对原则MySQL5.5支持的字符集和校对原则常用字符集和校对原则确定字符集和校对原则描述字符集的系统变量MySQL用下列的系统变量描述字符集。字符集的依存关系修改默认字符集修改默认字符集使用MySQL字符集时的建议预习建立数据库和表配套练习总结前言MySQL能够支持39种字符集和127个校对原则。细化为4个层次:服务器(Server)、数据库(DataBase)、数据表(Table)和连接层(Connection)。 MySQL服务

### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncati

org.springframework.dao.DataIntegrityViolationException: ###Errorupdatingdatabase. Cause:com.mysql.cj.jdbc.exceptions.MysqlDataTruncation:Datatruncation:Outofrangevalueforcolumn'article_id'atrow1###Theerrormayexistincom/mszlu/blog/mapper/CommentMapper.java(bestguess)###Theerrormayinvolvecom.mszlu.bl

【数据库错误】Could not create connection to database server. Attempted reconnect 3 times. Giving up.

错误日志:java.sql.SQLNonTransientConnectionException:Couldnotcreateconnectiontodatabaseserver.Attemptedreconnect3times.Givingup. atcom.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) atcom.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) atcom.mysql.cj.jdbc.

android - 在进程之间传递游标(Parcelable Cursor)

我需要将Cursor(SQLiteCursor)从服务传递到API10上的应用程序,并且很难找到一个像样的(和快速)解决方案。我看过CursorWindow类。这是Parcelable但我无法在API10上实例化此类以使用SQLiteCursor.fillWindow()因为它没有有效的构造函数。CursorWindow(boolean)已弃用。即使我得到一个包含来自SQLiteCursor的数据的CursorWindow实例,我如何将这个窗口复制到一个新的Cursor中?我应该为此使用什么Cursor实现?我看不到扩展AbstractWindowedCursor的可用Cursor。感

android - 构造函数 SimpleCursorAdapter(Context, int, Cursor, String[], int[]) 已弃用

如何解决这个问题?TheconstructorSimpleCursorAdapter(Context,int,Cursor,String[],int[])isdeprecated和ThemethodmanagedQuery(Uri,String[],String,String[],String)fromthetypeActivityisdeprecated代码如下:packagecom.example.kamusdigital;importandroid.app.Activity;importandroid.os.Bundle;importandroid.view.View;impor

android - 非法状态异常 : database already closed (using ViewPager)

我对导致此错误的原因感到困惑,因为我已确定我正在正确关闭我的数据库适配器(至少我认为我是)。以下是LogCat的内容(它们的标签都是AndroidRuntime):FATALEXCEPTION:mainjava.lang.IllegalStateException:database/data/data/com.acedit.assignamo/databases/data.db(conn#0)alreadyclosedatandroid.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2082)atan

android - 陈旧数据异常 : access closed cursor

在我的应用程序中,点击足够多之后,我得到了这个错误:06-0819:47:59.967:ERROR/AndroidRuntime(2429):java.lang.RuntimeException:Unabletopauseactivity{com.MYAPP.app/com.MYAPP.app.MainActivity}:android.database.StaleDataException:Accessclosedcursor我有一个选项卡Activity(我的MainActivity),它有一个ListActivity作为每个选项卡的内容。在每个ListActivity的onCre

android - 错误 - android.database.CursorIndexOutOfBoundsException : Index 0 requested,,大小为 0

我正在尝试做一个数据库,但是我有一个问题...这是日志:E/AndroidRuntime(894):FATALEXCEPTION:mainE/AndroidRuntime(894):java.lang.IllegalStateException:CouldnotexecutemethodoftheactivityE/AndroidRuntime(894):atandroid.view.View$1.onClick(View.java:3044)E/AndroidRuntime(894):atandroid.view.View.performClick(View.java:3511)E/