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

Unity3d 使用sqlite数据库

dbAccess.js
import System.Data; // we import our data class
import Mono.Data.SqliteClient; // we import our sqlite client

class dbAccess {
// variables for basic query access
private var connection : String;
private var dbcon : IDbConnection;
private var dbcmd : IDbCommand;
private var reader : IDataReader;

function OpenDB(p : String){
connection = "URI=file:" + p; // we set the connection to our database
dbcon = new SqliteConnection(connection);
dbcon.Open();
}

function BasicQuery(q : String, r : boolean){ // run a baic Sqlite query
dbcmd = dbcon.CreateCommand(); // create empty command
dbcmd.CommandText = q; // fill the command
reader = dbcmd.ExecuteReader(); // execute command which returns a reader
if(r){ // if we want to return the reader
return reader; // return the reader
}
}

function CreateTable(name : String, col : Array, colType : Array){ // Create a table, name, column array, column type array
var query : String;
query = "CREATE TABLE " + name + "(" + col[0] + " " + colType[0];
for(var i=1; i<col.length; i++){
query += ", " + col[i] + " " + colType[i];
}
query += ")";
dbcmd = dbcon.CreateCommand(); // create empty command
dbcmd.CommandText = query; // fill the command
reader = dbcmd.ExecuteReader(); // execute command which returns a reader

}

function InsertIntoSingle(tableName : String, colName : String, value : String){ // single insert
var query : String;
query = "INSERT INTO " + tableName + "(" + colName + ") " + "VALUES (" + value + ")";
dbcmd = dbcon.CreateCommand(); // create empty command
dbcmd.CommandText = query; // fill the command
reader = dbcmd.ExecuteReader(); // execute command which returns a reader
}

function InsertIntoSpecific


相关文档:

SQLite学习笔记

 SQLite学习笔记
1.查看有哪些数据库,显示数据库列表
show databases;
2.显示表的结构
方法一:
use student;
describe student;
方法二:
des student.student;
方法三:
show columns from student;
3.显示MYSQL的版本
select version();
4.显示库中的数据表
use  mysql;
show tables;
5.建库 ......

SQLITE与ACCESS性能简单测试对比

这段时间在做CMS(客户管理系统,不是内容管理)的访问管理功能,要求实现对服务提供设备,客户端,计费,权限认证等信息的存储统计,远程管理。要求系统发布要方便,远程管理软件要跑在WIN平台。考虑到系统规模,客户要求,最后选择了WIN+ACCESS的方案,而最近又发现一个免费的SQLITE,而且可能在以后的手持设备上用,花点 ......

SQLite数据类型

一般数据采用的固定的静态数据类型,而SQLite采用的是动态数据类型,会根据存入值自动判断。SQLite具有以下五种数据类型:
1.NULL:空值。
2.INTEGER:带符号的整型,具体取决有存入数字的范围大小。
3.REAL:浮点数字,存储为8-byte IEEE浮点数。
4.TEXT:字符串文本。
5.BLOB:二进制对象。
转自:http://www.cnblo ......

SQLite支持的数据类型(日期函数)


SQLite驱动支持的SQL 列类型
类型描述
TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB, BYTEA
不限制长度的字符串类型. 二进制数据必须安全地编码存储, 见text类型.
CHAR(), VARCHAR(), TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT
不限制长度的字符串类型. 不会被截断或者填充
ENUM
不限制长度的字符串类型. 不像 MySQL, 使用 ......

Sqlite移植到ARM开发板

Sqlite3.3.8移植
1、下载sqlite-3.3.8.tar.gz源码包,解压tar –zxvf sqlite-3.3.8.tar.gz
2、Cd sqlite-3.3.8
3、手动修改makefile 文件,目录下有一个makefile案例文件: Makefile.linux-gcc
4、重命名一个Makefile文件,cp Makefile.linux-gcc Makefile
5、   打开Makefile文件:vi Makefile
6、&nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号