Page 832 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 832

Ⅳ.  CodeVision  Source  Code



             import  android.database.sqlite.SQLiteOpenHelper;

             import  android.util.Log;


             import  java.sql.Timestamp;

             import  java.util.ArrayList;


             /**
               *  Created  by  user  on  2016-10-20.
              */



             public  class  DBHelper  extends  SQLiteOpenHelper{



                  private  static  final  String DATABASE_NAME  = "data";
                  private  static  final  String DATABASE_TABLE  =  "park_state";
                  private  static  final  String DATABASE_TA_LOG="park_log";
                     private  static  final  int  DATABASE_VERSION  =  16;
                  private  static  final  String DATABASE_CREATE  =

                             "create table "+DATABASE_TABLE+
                                        "(num  integer  primary  key  autoincrement  not null,"+
                                        "locate  text not null, state int not null,id  text  not  null);";



                  private  static  final  String DATABASE_LOG  =
                             "create table "+DATABASE_TA_LOG+
                                        "(num  integer  primary  key  autoincrement  not null,"+
                                        "locate  text not null, state int not null,  "  +

                                        "id  text  not null, time  DATETIME DEFAULT
             (DATETIME(CURRENT_TIMESTAMP,  'LOCALTIME'))  not  NULL,money  int  not  null);";





                        public  DBHelper(Context  context)  { super(context,  DATABASE_NAME,  null,
             DATABASE_VERSION);
                  }



                        @Override
                        public  void  onCreate(SQLiteDatabase  db)  {
                             db.execSQL(DATABASE_CREATE);

                             db.execSQL(DATABASE_LOG);



                                                                                               정보통신기기과
                                                         -  825  -
   827   828   829   830   831   832   833   834   835   836   837