Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3433053
  • 博文数量: 754
  • 博客积分: 10132
  • 博客等级: 上将
  • 技术积分: 7780
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-14 23:36
文章分类

全部博文(754)

文章存档

2012年(3)

2011年(39)

2010年(66)

2009年(167)

2008年(479)

我的朋友

分类: 数据库开发技术

2008-03-13 09:19:08

SQLite  for uClinux
1. Development Tools Need

hardware: Armsys44b0x development board
software: uclinux_armsys_051111.tgz , sqlite 2.8.15, sqlite-2.8.13-uc0 patch

2. Steps

2.1 Download

Download SQLite 2.8.15 from SQLite home page
Download sqlite patch for uclinux sqlite-2.8.13-uc0 patch, no patch for version 2.8.15 found , so we use sqlite-2.8.13-uc0 patch instead and it works well. The URL for the patch is:

 2.2 Installation
  Extract the sqlite-2.8.15 tarball into your uClinux-dist/user directory:
   tar -zxvf sqlite-2.8.15.tar.gz
  Change the current working path to sqlite source directory and apply the patch
   zcat sqlite-2.8.13-uc0.patch.gz |patch -p1
  
 2.3  Compliation

  In uClinux-dist/user/makefile add the sqlite directory in the list of directories to compile:
  dir_y += sqlite    # this is the line to add
  
  compile  and copy the generated sqlite binary to  romfs/bin
  make user_only

 3. Test

# cd /var
# sqlite ex1.db
SQLite version 2.8.12
Enter “.help” for instructions
sqlite> create table tbl1(one varchar(10), two smallint);
sqlite> insert into tbl1 values(’hello!’,10);
sqlite> insert into tbl1 values(’goodbye’, 20);
sqlite> select * from tbl1;
hello!|10
goodbye|20
sqlite> .databases
0           main        /var/ex1.db
1           temp        /var/tmp/sq
sqlite> .schema
create table tbl1(one varchar(10), two smallint);
sqlite> .exit
#
#  echo “select * from tbl1;”  | sqlite ex1.db
hello!|10
goodbye|20
#

阅读(1231) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~