Skip to content

Commit

Permalink
hzuapps#90 hzuapps#91 hzuapps#95 hzuapps#66 实验4-9(完成)
Browse files Browse the repository at this point in the history
实验完成
  • Loading branch information
zhongliang8851 committed Jun 15, 2016
1 parent f1ae481 commit 8a69e37
Show file tree
Hide file tree
Showing 10 changed files with 827 additions and 36 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.example.com1314080901210.Kechengbiao;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DBHelper extends SQLiteOpenHelper{
private static final String DATABASE_NAME="lesson.db";
private static final int DATABASE_VERSION=1;

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

@Override
public void onCreate(SQLiteDatabase arg0) {
// TODO Auto-generated method stub
arg0.execSQL("create table event (day_no integer not null,class_no integer not null,class_name text not null," +
"class_address text not null,class_teacher text not null,primary key (day_no,class_no,class_name))");
Log.i("database", "create event");
}

@Override
public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
// TODO Auto-generated method stub

}
public Cursor query(String sql, String[] args)
{
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(sql, args);
return cursor;
}
}
Loading

0 comments on commit 8a69e37

Please sign in to comment.