SHARE
TWEET

Untitled

a guest Mar 20th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.example.miss.databasesample;
  2.  
  3. import android.content.Context;
  4. import android.database.sqlite.SQLiteDatabase;
  5. import android.database.sqlite.SQLiteOpenHelper;
  6.  
  7. /**
  8.  * Created by MISS on 3/20/2019.
  9.  */
  10.  
  11. public class Dbase {
  12.  
  13.     public static final String  K_ID = "_id";
  14.     public static final String  K_NAME = "_name";
  15.     public static final String K_COURSE = "_course";
  16.     public static final String  DB_NAME = "DBStudRec";
  17.     public static final String DB_TABLE = "tblStudent";
  18.     public static final int DB_VERSION = 1;
  19.  
  20.     private DBHelper dbHelper;
  21.     private final Context context;
  22.     private SQLiteDatabase dbase;
  23.  
  24.     private static class DBHelper extends SQLiteOpenHelper{
  25.         public DBHelper(Context context){
  26.             super(context, DB_NAME, factory: null, DB_VERSION);
  27.         }
  28.     }
  29.     public void onCreate(SQLiteDatabase db){
  30.         db.execSQL("CREATE TABLE" + DB_TABLE + "("+ K_ID + "INTEGER KEY AUTOINCREMENT");
  31.     }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top