Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/364.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 字符串以在SQLite中创建完整数据库_Java_Android_String_Sqlite - Fatal编程技术网

Java 字符串以在SQLite中创建完整数据库

Java 字符串以在SQLite中创建完整数据库,java,android,string,sqlite,Java,Android,String,Sqlite,我编写这个字符串是为了在SQLite中创建一个数据库,但是在创建corso之前,我遇到了一个错误create EXPENDING。这是字符串: static final String DATABASE_CREAZIONE = "CREATE TABLE utente (id integer primary key autoincrement, " + "nome text not null, cognome text not null, "

我编写这个字符串是为了在SQLite中创建一个数据库,但是在创建corso之前,我遇到了一个错误create EXPENDING。这是字符串:

static final String DATABASE_CREAZIONE =
        "CREATE TABLE utente (id integer primary key autoincrement, "
                + "nome text not null, cognome text not null, "
                + "email text not null, password text not null);"
                + "CREATE TABLE corso (id integer primary key autoincrement," +
                "nome text not null);" +
                "CREATE TABLE prenotazione (id_utente integer primary key autoincrement, "
                + "id_docente integer primary key autoincrement, data DATETIME not null);"+
                "CREATE TABLE docenza (id integer primary key autoincrement, "
                + "nome_corso text not null, nome_prof text not null); "+
                "CREATE TABLE professore (id integer primary key autoincrement, "
                + "nome text not null, cognome text not null); ";

只有Android Studio IDE发出了警告,但有一个合理的理由

通常用于执行类似这样的SQL的Android SQLiteDatabase execSQL一次只执行一条语句。之后的任何事情;将被忽略

您需要将SQL拆分为单独的execSQL调用。这也将消除IDE警告,并执行SQL的其他部分,以便您可以检测运行时问题,如Boken在其回答中报告的问题