You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
981 B
34 lines
981 B
package com.android.jingdong.dao;
|
|
|
|
import android.content.Context;
|
|
import android.database.sqlite.SQLiteDatabase;
|
|
import android.database.sqlite.SQLiteOpenHelper;
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
public class DatabaseHelper extends SQLiteOpenHelper {
|
|
|
|
public DatabaseHelper(@Nullable Context context, int version) {
|
|
super(context, " ", null, version);
|
|
}
|
|
|
|
@Override
|
|
public void onCreate(SQLiteDatabase db) {
|
|
// 创建数据库
|
|
String createOrders = "create table orders (" +
|
|
"id integer primary key autoincrement," +
|
|
"name text," +
|
|
"image integer," +
|
|
"money real," +
|
|
"time text," +
|
|
"username text)";
|
|
|
|
db.execSQL(createOrders);
|
|
}
|
|
|
|
@Override
|
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
|
|
|
}
|
|
}
|