码迷,mamicode.com
首页 > 数据库 > 详细

SQLite数据库介绍

时间:2014-08-08 18:27:27      阅读:243      评论:0      收藏:0      [点我收藏+]

标签:sqlite3

  SQLite是一个文件数据库,不像Mysql,Oracle等数据库有很多进程,被很多语言bullet-in成了自己的模块,python、php、ruby都支持,作为一个小app或者更大软件不需要连接网络上数据库是一个很好的选择,一些linux主机还会初始安装sqlite.


下面给出一个最简单的示例代码:

import sqlite3
conn = sqlite3.connect(‘test.db‘)
cur = conn.cursor()
cur.execute(‘select count(*) from tab_test ‘)
rs = cur.fetchone()
count = rs[0]
print "Records count:",count


参考文章

http://www.sqlite.org/    官网

http://www.sqlite.org/cli.html   shell command

http://blog.sina.com.cn/s/blog_3fc8570201000d6w.html

本文出自 “方法总比问题多” 博客,请务必保留此出处http://xubcing.blog.51cto.com/3502962/1537518

SQLite数据库介绍,布布扣,bubuko.com

SQLite数据库介绍

标签:sqlite3

原文地址:http://xubcing.blog.51cto.com/3502962/1537518

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!