zoukankan      html  css  js  c++  java
  • SQLite 粗劣内容

    SQLite 的官网

    http://addons.mozillan.org/firefox/addon/sqlite-manager/

    http://www.sqlite.org

     

    sqlite3 *sqlite = nil;

        

        NSString *filePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/data.file" ];

        

        //打开数据库

        int result  = sqlite3_open([filePath  UTF8String], &sqlite);

        if (result !=SQLITE_OK) {

            NSLog(@"创建失败!!!");

            return ;

        }

        

        //创建表的SQL语句

        

        NSString *sql = @"CREATE TABLE IF NOT EXISTS UserTable(userName text PRIMARY KEY ,password text,email text)";

        //执行SQL语句

        char *error;

        result = sqlite3_exec(sqlite, [sql  UTF8String], NULL, NULL, &error);

        if (result != SQLITE_OK) {

            NSLog(@"创建数据库失败:%s",error);

            return ;

        }

        //插如入一条数据

        //INSERT OR REPLACE INTO UserTable (userName,password,email) VALUES(?,?,?);

        //更新一条数据

        //UPDATE UserTable set password = '' where userName = '';

        

        //查询数据

        

        //SELECT userName ,password,eamil FROM UserTable where username = '';

       

        //删除数据

       // DELETE FROM UserTable WHERE username ='';

        

        //关闭数据库

        

        sqlite3_close(sqlite);

  • 相关阅读:
    nginx 负载均衡
    nginX 安装 启动
    nginx 简介
    使用ASDM 管理 ciscoASA设备
    OSPF配置实验(一)
    VRRP
    HSRP 详解
    Rip 动态路由协议
    配置ASA防火墙 远程管理方式
    Oracle 重启监听
  • 原文地址:https://www.cnblogs.com/meixian/p/5371114.html
Copyright © 2011-2022 走看看