有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java从Sqlite查询数据库获取项

我创建了一个数据库,表名为“Accounts”,共有三列。一个名为userId,另一个名为accountType。第三个帐户是accountId我想创建的函数是

     private int getNextAccountIdForUserId (String ourUserId, int ourAccountType)
            {
              int nextId = kFirstIDValue;
              Cursor mCursor = mDb.query(true, ACCOUNT_TABLE, new String[] {"userId", accountType},"accountId", null, null, null, null, null); 
              ...
              //what more to do to get the accountId of ourUserId and ourAccountType

            } 

我想检索我定义的特定accountType和userId的accountId。请告知所用查询的正确格式


共 (0) 个答案