forked from hzuapps/android-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
实验完成
- Loading branch information
1 parent
f1ae481
commit 8a69e37
Showing
10 changed files
with
827 additions
and
36 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
...in/java/edu/hzuapps/androidworks/homeworks/com1314080901210/Com1314080901210Activity.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
app/src/main/java/edu/hzuapps/androidworks/homeworks/com1314080901210/DBHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.