0924 sqlite lib test ok
今天看看程序,离绿色还是差一点,用的是MDB数据库,需要MDAC,想到SQLITE,看看资料。
2006-Aug-12 – Version 3.3.7
Version 3.3.7 includes support for loadable extensions and virtual tables. But both features are still considered "beta" and their APIs are subject to change in a future release. This release is mostly to make available the minor bug fixes that have accumulated since 3.3.6. Upgrading is not necessary. Do so only if you encounter one of the obscure bugs that have been fixed or if you want to try out the new features.
关于SQLite
SQLite是一个小型的C程序库,实现了独立的,可嵌入的,零配置的SQL数据库引擎。特性包括:
事务操作是原子,一致,孤立,并且持久的(ACID),即使在系统崩溃和电源故障之后。
零配置——不需要安装和管理。
实现了绝大多数SQL92标准。 (不支持的特性)
整个数据库存储在一个单一的文件中。
数据库文件可以在不同字节序的机器之间自由地共享。
支持最大可达2T的数据库。 (241 字节)
字符串和BLOB类型的大小只受限于可用内存。
小的代码: 完整配置的少于250KB,忽略一些可选特性的少于150KB。
在大多数常见操作上比流行的客户/服务器数据库引擎更快。
简单,易于使用的API。
内建TCL绑定。 另外提供可用于许多其他语言的绑定。
具有良好注释的源代码,95%经过测试。
独立:没有外部依赖。
源代码位于公共域。 可用于任何用途。
SQLite发行版包含一个独立的命令行访问程序(sqlite),可用于管理SQLite数据库,并适合作为一个如何使用SQLite库的例子
下载:
SQLite库的C语言源代码。与下面的tar压缩包不同的是,所有预处理和自动产生代码的部分在这些源代码上已经完成。 所以它们可以使用任何普通的C编译器编译。该文件是为缺乏Unix支持的MS-Windows用户提供的。
VC新建一个LIB,将文件全部加入,编译
tclsqlite.c(20) : fatal error C1083: Cannot open include file: \’tcl.h\’: No such file or directory
去掉文件,提示
warning C4244: \’function\’ : conversion from \’__int64 \’ to \’int \’, possible loss of databtree.c(3452) : warning C4761: integral size mismatch in argument; conversion supplied
不管,得到LIB。加上SQLITE3.H,编程接口已经OK
从CODEPROJECT找到
CppSQLite – C++ Wrapper for SQLite By Rob Groves.
A C++ wrapper around the SQLite embedded database library.
This article describes CppSQLite, a very thin C++ wrapper around the public domain SQLite database library.
A description of how to link applications with SQLite is provided, then an example program using CppSQLite is presented, and finally the CppSQLite classes are documented.
下载代码,把头文件和LIB文件改为自己生成的,运行,获得TEST.DB
从SOURCEFORDE下载
SQLite Database browser is a light GUI editor for SQLite databases, built on top of QT. The main goal of the project is to allow non-technical users to create, modify and edit SQLite databases using a set of wizards and a spreadsheet-like interface.
打开数据库,OK。
Project Admins: tabuleiro
Operating System: All 32-bit MS Windows (95/98/NT/2000/XP), All POSIX (Linux/BSD/UNIX-like OSes), Linux, OS X
License: Public Domain
Category: Database
这个倒是比较厉害,看来QT还是有独到之处
SQLite Version: 3.3.7
emp table exists=FALSE
Creating emp table
emp table exists=TRUE
DML tests
1 rows inserted
1 rows updated
1 rows deleted
Transaction test, creating 50000 rows please wait…
50000 rows in emp table in 6 seconds (that was fast!)
Auto increment test
1 rows deleted
primary key: 1
primary key: 2
primary key: 3
primary key: 4
primary key: 5
Select statement test
empno(integer)&line;empname(char(20))&line;
1&line;Empname000001&line;
2&line;Empname000002&line;
3&line;Empname000003&line;
4&line;Empname000004&line;
5&line;Empname000005&line;
SQLite sprintf test
insert into emp (empname) values (\’He\’\’s bad\’);
insert into emp (empname) values (NULL);
getTable() test
empno&line;empname&line;
1&line;Empname000001&line;
2&line;Empname000002&line;
3&line;Empname000003&line;
4&line;Empname000004&line;
5&line;Empname000005&line;
6&line;He\’s bad&line;
7&line;NULL&line;
Binary data test
Stored binary Length: 256
Retrieved binary Length: 256
Transaction test, creating 50000 rows please wait…
50000 rows in emp table in 2 seconds (that was even faster!)
End of tests
历史博文
- 註音 - 2010
- 20080719 flex debug trace - 2009
- 20070627 uclinux make config 2 _IO_read_ptr - 2008
- 0115 二泉映月 - 2006
- 让你的VC6集成CVS - 2005