zoukankan      html  css  js  c++  java
  • 冲刺!

    昨天:画了增删改查的xml界面文件。

    困难:listview绊了我一下。

    今天:研究了Android SQLite数据库,初步定义了五个变量。增删改查也有了些眉目。

    package com.example.zbytexttwo;
    
    import android.content.Context;
    import android.database.sqlite.SQLiteDatabase;
    import android.database.sqlite.SQLiteDatabase.CursorFactory;
    import android.database.sqlite.SQLiteOpenHelper;
    
    public class dbHelper extends SQLiteOpenHelper {
        public static final String TB_NAME = "bills";
        public dbHelper(Context context, String name, CursorFactory factory, int version) {
            super(context, name, factory, version);
            // TODO Auto-generated constructor stub
        }
        @Override
        public void onCreate(SQLiteDatabase db) {
            // TODO Auto-generated method stub
            db.execSQL("CREATE TABLE IF NOT EXISTS " +
                    TB_NAME + " ( _id integer primary key autoincrement," +
                    "leixing varchar," +
                    "riqi varchar,"+
                    "jine integer," +
                    "beizhu varchar"+
                    ") ");
        }
        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            // TODO Auto-generated method stub
            db.execSQL("DROP TABLE IF EXISTS " + TB_NAME);
            onCreate(db);
        }
    }
    View Code
  • 相关阅读:
    关于float与double
    【编程实践】母牛生小牛
    wlan的QOS配置
    C语言itoa函数和atoi 函数
    类似于QQ的简单的聊天代码
    多线程吃饺子练习
    线程练习
    接口练习
    电视练习
    5.22
  • 原文地址:https://www.cnblogs.com/vvxvv/p/12775586.html
Copyright © 2011-2022 走看看