SHARE
TWEET

Untitled

a guest Nov 19th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package id.com.rumahcoding.sekolahku
  2.  
  3. import android.content.Context
  4. import android.database.sqlite.SQLiteDatabase
  5. import android.database.sqlite.SQLiteOpenHelper
  6.  
  7. class DatabaseHelper (context : Context)
  8.     : SQLiteOpenHelper (context , "sekolah.db"
  9.     , null ,  1){
  10.  
  11.     override fun onCreate(db: SQLiteDatabase?) {
  12.  
  13.         var query = "cREate Table siswa ( " +
  14.                 "id INTEGER PRIMARY KEY AUTOINCREMENT, " +
  15.                 COL_NAMADEPAN+" TEXT, " +
  16.                 "nama_belakang TEXT, " +
  17.                 "no_hp TEXT, " +
  18.                 "jenjang TEXT, " +
  19.                 "hobi TEXT, " +
  20.                 "gender TEXT, " +
  21.                 "alamat TEXT, " +
  22.                 "email TEXT, " +
  23.                 "tgl_lahir TEXT)"
  24.         db?.execSQL(query)
  25.  
  26.     }
  27.  
  28.     override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
  29.  
  30.  
  31.     }
  32.  
  33.     companion object{
  34.         val COL_NAMADEPAN = "nama_depan"
  35.     }
  36.  
  37.  
  38. }
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