public class DBController extends SQLiteOpenHelper {
private static final String LOGCAT=null;
SharedPreferences sp;
public DBController(Context applicationcontext) {
super(applicationcontext, "school.db", null, 1);
Log.d(LOGCAT, "Created");
}
@Override
public void onCreate(SQLiteDatabase db) {
db = this.getWritableDatabase();
String query,query1,query2;
query="CREATE TABLE Teachers(Name TEXT, E_Mail VARCHAR, Password VARCHAR, Mob_No TEXT, Department TEXT)";
query1="CREATE TABLE Students(Roll_No VARCHAR ,Name TEXT, E_Mail VARCHAR, Semester INTEGER, Mob_No TEXT, Department TEXT)";
query2="CREATE TABLE Classes1(E_Mail VARCHAR, Assign_class VARCHAR)";
// query1="CREATE TABLE Subjects(Branch_Name TEXT ,Branch_Code VARCHAR, Semester INTEGER, Sub_Name VARCHAR, Sub_Code VARCHAR, Type TEXT)";
db.execSQL(query);
db.execSQL(query1);
db.execSQL(query2);
Log.d(LOGCAT, "Teachers Created");
}
显示没有这样的表存在。课程1 ..请明确我的疑问
答案 0 :(得分:0)
asi se crea las tablas xml en android studio
<string name="db_v1">
CREATE TABLE tbl_Lista(
listaId INTEGER NOT NULL,
nombre TEXT NOT NULL,
PRIMARY KEY(listaId)
);
CREATE TABLE tbl_Item(
itemId INTEGER NOT NULL,
descripcion TEXT NOT NULL,
checked INTEGER NOT NULL,
listasId INTEGER NOT NULL,
PRIMARY KEY(itemId)
);
FOREIGN KEY (listasId)REFERENCES tbl_Lista(listaId)
</string>