Reached MAX size for compiled-sql statement cache for database

后端 未结 2 1940
盖世英雄少女心
盖世英雄少女心 2021-02-04 12:56

My code is

ContentValues values; 
values = new ContentValues();
        values.put(SQLHelper.EMPLOYEE_LPN, jsObj.getString(\"lpn\"));
db.update(SQLHelper.EMPL         


        
2条回答
  •  南旧
    南旧 (楼主)
    2021-02-04 13:20

    I was searching for this today, and came across this doc.

    http://ormlite.com/docs/query-builder

    This solved my issue. This is the code from the link above

    QueryBuilder queryBuilder =
      accountDao.queryBuilder();
    Where where = queryBuilder.where();
    SelectArg selectArg = new SelectArg();
    // define our query as 'name = ?'
    where.eq(Account.NAME_FIELD_NAME, selectArg);
    // prepare it so it is ready for later query or iterator calls
    PreparedQuery preparedQuery = queryBuilder.prepare();
    
    // later we can set the select argument and issue the query
    selectArg.setValue("foo");
    List accounts = accountDao.query(preparedQuery);
    // then we can set the select argument to another
    // value and re-run the query
    selectArg.setValue("bar");
    accounts = accountDao.query(preparedQuery);
    

提交回复
热议问题