在Android的SQLiteDatabase光标大小限制 [英] Cursor size limit in Android SQLiteDatabase

查看:328
本文介绍了在Android的SQLiteDatabase光标大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载从互联网分贝。我将其保存在我的datases文件夹,我打开它。 里面的数据库有一个表广告与6个领域。 2字段是BLOB。当我想从这个表来读取...我有一些问题...我注意到,当我读到一排BLOB字段更大于1兆字节,这将导致一个例外......从排得场槽0 COL 0失败。如果它是一个小斑点,一切都OK了...在此先感谢:)

I download a db from internet. I save it in my datases folder and I open it. Inside the db there is a table "Ads" with 6 fields. 2 of these fields are BLOB. When I want to read from this table... I have some problem... I noticed that when I read a row with a blob field more bigger than 1 mega byte, this causes an exception... "get field slot from row 0 col 0 failed". if it's a little blob, all is ok... thanks in advance :)

推荐答案

有1MB对由于动态DECOM pression内部资产的限制; 1MB的限制也似乎适用于光标的斑点,但这似乎并没有被记录任何地方。

There's a limit of 1MB on internal assets due to dynamic decompression; the 1MB limit also seems to apply to Cursor blobs but this doesn't seem to be documented anywhere.

通常你应该避免水滴在SQLite作为他们表现不佳;而不是BLOB数据保存为一个文件,并存储在你的数据库文件的位置。

Generally you should avoid blobs in SQLite as they perform poorly; instead save the blob data as a file and store the location of the file in your DB.

这篇关于在Android的SQLiteDatabase光标大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆