sqlite DatabaseUtils
来源:互联网 发布:淘宝二合一口令 编辑:程序博客网 时间:2024/05/29 14:31
This class allows users to do multiple inserts into a table but compile the SQL insert statement only once, which may increase performance.
此类允许用户对表进行多次插入,但是只编译一次SQL插入语句,这可能会提高性能。
1.public static final void writeExceptionToParcel(Parcel reply, Exception e)
Special function for writing an exception result at the header of a parcel, to be used when returning an exception from a transaction. exception will be re-thrown by the function in another process
用于在从事务中返回异常时使用的用于在包裹标头处写入异常结果的特殊函数。 异常将被另一个进程中的函数重新抛出
2.public static String sqlEscapeString(String value)
3.public static final void appendValueToSql(StringBuilder sql, Object value)
4.public static void cursorStringToContentValues(Cursor cursor,
String field,
ContentValues values)
从Cursor中的字段读取一个字符串,并将其写入InsertHelper。
5.public static void cursorStringToContentValues(Cursor cursor,
String field,
ContentValues values,
String key)
从游标中的字段读取字符串,并将其写入映射。
cursor - The cursor to read from
field - The TEXT field to read
values - The ContentValues to put the value into, with the field as the key
key - The key to store the value with in the map
cursorIntToContentValues
public static void cursorIntToContentValues(Cursor cursor,
String field,
ContentValues values)
Reads an Integer out of a field in a Cursor and writes it to a Map.
参数:
cursor - The cursor to read from
field - The INTEGER field to read
values - The ContentValues to put the value into, with the field as the key
cursorIntToContentValues
public static void cursorIntToContentValues(Cursor cursor,
String field,
ContentValues values,
String key)
Reads a Integer out of a field in a Cursor and writes it to a Map.
参数:
cursor - The cursor to read from
field - The INTEGER field to read
values - The ContentValues to put the value into, with the field as the key
key - The key to store the value with in the map
cursorLongToContentValues
public static void cursorLongToContentValues(Cursor cursor,
String field,
ContentValues values)
Reads a Long out of a field in a Cursor and writes it to a Map.
参数:
cursor - The cursor to read from
field - The INTEGER field to read
values - The ContentValues to put the value into, with the field as the key
cursorLongToContentValues
public static void cursorLongToContentValues(Cursor cursor,
String field,
ContentValues values,
String key)
Reads a Long out of a field in a Cursor and writes it to a Map.
参数:
cursor - The cursor to read from
field - The INTEGER field to read
values - The ContentValues to put the value into
key - The key to store the value with in the map
cursorDoubleToCursorValues
public static void cursorDoubleToCursorValues(Cursor cursor,
String field,
ContentValues values)
Reads a Double out of a field in a Cursor and writes it to a Map.
参数:
cursor - The cursor to read from
field - The REAL field to read
values - The ContentValues to put the value into
cursorDoubleToContentValues
public static void cursorDoubleToContentValues(Cursor cursor,
String field,
ContentValues values,
String key)
Reads a Double out of a field in a Cursor and writes it to a Map.
参数:
cursor - The cursor to read from
field - The REAL field to read
values - The ContentValues to put the value into
key - The key to store the value with in the map
cursorRowToContentValues
public static void cursorRowToContentValues(Cursor cursor,
ContentValues values)
Read the entire contents of a cursor row and store them in a ContentValues.
参数:
cursor - the cursor to read from.
values - the ContentValues to put the row into.
queryNumEntries
public static long queryNumEntries(SQLiteDatabase db,
String table)
Query the table for the number of rows in the table.
参数:
db - the database the table is in
table - the name of the table to query
返回:
the number of rows in the table、
longForQuery
public static long longForQuery(SQLiteDatabase db,
String query,
String[] selectionArgs)
Utility method to run the query on the db and return the value in the first column of the first row.
用于对数据库运行查询的实用方法,并返回第一行第一列中的值。
createDbFromSqlStatements
public static void createDbFromSqlStatements(Context context,
String dbName,
int dbVersion,
String sqlStatements)
Creates a db and populates it with the sql statements in sqlStatements.
参数:
context - the context to use to create the db
dbName - the name of the db to create
dbVersion - the version to set on the db
sqlStatements - the statements to use to populate the db.
This should be a single stringof the form returned by sqlite3’s .dump command (statements separated bysemicolons)
- sqlite DatabaseUtils
- android:利用DatabaseUtils.InsertHelper提高insert速度
- Weka报错"Unknow data type INT. Add entry in weka/experiment/DatabaseUtils.props"
- SQLite
- SQLite
- SQLite
- SQLite
- SQLite
- sqlite
- sqlite
- SQLite
- SQLite
- sqlite
- SQLite
- SQLite
- SQLite
- SQLite
- SQLite
- Unity UGUI图文混排(七) -- 下划线
- Java设计模式----单例模式(Singleton)
- wonderware配置-Intouch读取Historian数据 8
- adb端口被占用导致无法启动
- Linux下长时间ping网络加时间戳并记录到文本
- sqlite DatabaseUtils
- excel导入,用反射匹配字段名
- iOS ——微信支付
- 习艺先习德01
- 如何彻底卸载,安装和启动ssh服务
- Gson 的简单使用
- 文件传输原理,与二进制、字节、字符理解
- Java中String、StringBuilder、StringBuffer的区别
- 按数字大小排序 取得最大值或最小值