我想实现下面的代码:
String updateQuery ="INSERT INTO MAAccounts(userId, accountId, accountType, accountName, parentAccountId ) VALUES(?, ?, ?, ?, ?)";
Cursor c = mDb.rawQuery(updateQuery, new String[]{
stringToDB(account.userId),
integerToDB(account.accountId).toString(),
integerToDB(account.accountType.getValue()).toString(),
stringToDB(account.accountName),
integerToDB(account.parentAccountId).toString(),
});
现在 parentAccoudId (Type int )的初始值是 null。实际上是把null转化为 to.String。
当我运行它时,给出空指针的错误。
我想在数据库中存储null值,如何实现?