sqlite3学习体会

在网上闲逛,看到sqlite3这个数据库,想起之前搞安卓开发的时候见过这个词

了解了下,不错,正适合当前的一些需求


零散记一点:

一开始的时候发现插入速度很慢,查了下,原来要使用事务,先把所有数据送入内容,然后一次性写入硬盘文件


关于编码

如果数据库文件路径含有中文或者文件名含有中文,则打开和创建数据库出错或者乱码,

要注意转码,具体看文章

http://blog.csdn.net/blueblood7/article/details/6576716

注意是ascii转为utf8。主要调用MultiByteToWideChar


关于文档,看了一些,还是官方网站的好,比较新,讲得也比较明白,比如这段

This routine converts SQL text into a prepared statement object and returns a pointer to that object. This interface requires adatabase connection pointer created by a prior call to sqlite3_open() and a text string containing the SQL statement to be prepared. This API does not actually evaluate the SQL statement. It merely prepares the SQL statement for evaluation.

Think of each SQL statement as a small computer program. The purpose of sqlite3_prepare() is to compile that program into object code. The prepared statement is the object code. The sqlite3_step() interface then runs the object code to get a result.

Note that the use of sqlite3_prepare() is not recommended for new applications. A newer alternative routine sqlite3_prepare_v2()should be used instead.


一下就明白这个statement为何物了



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值