易截截图软件、单文件、免安装、纯绿色、仅160KB

SQLite的封装类

package
{
import flash.data.SQLConnection;
import flash.data.SQLResult;
import flash.data.SQLStatement;
import flash.errors.SQLError;
import flash.events.SQLErrorEvent;
import flash.events.SQLEvent;
import flash.filesystem.File;

import mx.collections.ArrayCollection;

public class DBUtil
{
/**
* 数据库操作类别
**/
private const typeArr:Array = ['select','insert','update','delete','create','alter','drop'];

/**
* 连接
**/
private var conn:SQLConnection;

/**
* 声明
**/
private var stmt:SQLStatement;

/**
* 结果集合
**/
private var rsAC:ArrayCollection;

public function DBUtil()
{
}

/**
* 获得连接
**/
private function getConn():SQLConnection
{
if(this.conn == null){
conn = new SQLConnection();
conn.addEventListener(SQLEvent.OPEN, sqlOpen);
conn.addEventListener(SQLErrorEvent.ERROR, sqlError);
}
return this.conn;
}

/**
* 关闭连接
**/
private function closeConn():void
{
if(this.conn != null){
this.conn.close();
this.conn = null;
}
}

/**
* 获得声明
**/
private function getStatement():SQLStatement
{
if(this.stmt == null)
{
stmt = new SQLStatement();
stmt.sqlConnection = getConn();
stmt.addEventListener(SQLErrorEvent.ERROR, sqlError);
}
return this.stmt;
}

/**
* 关闭声明
**/
private functio


相关文档:

SQLite学习笔记(2)

再说在linux下建立.a 和点so
     到网站下载 sqlite-amalgamation-3.6.22.tar.gz 这个包,反正我下了sqlite3-3.6.22.bin.gz解压后编译不了。
     解压,运行
    #  ./configure --host=armv5l-linux --prefix=/opt/sqlite3/arm --enable-threadsafe. ......

SQLite启动事物

事务(DbTransaction):
SQLite 缺省为每个操作启动一个事务,所以成批插入的时候,启动事务,比不启动事务快n倍。
在没启动事务之前往Sqlite数据库里插入1000多条数据的情况,结果每次都需要一两分钟才能完成.
而在启动事物以后所需要的时间直接变成不到2秒!原来sqlite花两分钟是由于ExecuteNonQuery方法执行时自己提交 ......

SQLite数据库的挂接及常用命令

安装:
官方网站下载最新的sqlite版本
官方网站: http://www.sqlite.org/
下载地址为: http://www.sqlite.org/download.html
官方的下载页面提供了很多版本的下载…这里介绍一下;
Source Code: 源代码版本的下载
Documentation:  相关文档
Precompiled Binaries for Linux / Precompiled Binaries For Mac ......

SQLite中不支持的sql语法

今天很自然的在写Sql语句的时候用了Top,一开始没发现问题,因为我从数据库读出的值正好是0,而我习惯变量定义的时候也都赋值0,可是到我不要0的时候我就发现问题了。后来才知道,可爱的小sqlite竟然有不支持的sql语法。
  看到某个论坛有个新手也发现了这个问题并发帖了,下面一牛人的回复是“top是哪家的关键词?s ......

SQLite数据库的增删改查代码

//搜集整理了一下网上的代码.找了半天居然找不到一条插入语句.好郁闷的
//感觉速度还可以.小文件.很多小应用程序在用这个数据库
//SQLite使用办法.直接COPYDLL文件System.Data.SQLite.DLL到应用程序DEBUG目录下。 然后在项目中添加引用,找到这个文件即可
//添加引用
using System;
using System.Collections.Generic; ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号