小编use*_*906的帖子

SQLiteException:接近"":编译时出现语法错误(代码1)

编译时我有这个错误,我不知道为什么,任何人都可以帮助我吗?

public static final String TABLE_BEERS ="cervezas";

// Contacts Table Columns names
public static final String KEY_NAME = "_id";
public static final String KEY_COMPANY = "company";
public static final String KEY_TYPE = "type";
public static final String KEY_ALCOHOL = "alcohol";


public DatabaseHandler(Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
    // TODO Auto-generated constructor stub
}

@Override
public void onCreate(SQLiteDatabase db) {

    String query = String.format("CREATE TABLE %s (%s STRING PRIMARY KEY,%s TEXT, %s TEXT, %s TEXT);", 
            TABLE_BEERS, KEY_NAME, KEY_COMPANY,
            KEY_TYPE, KEY_ALCOHOL); …
Run Code Online (Sandbox Code Playgroud)

sqlite android exception

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

exception ×1

sqlite ×1