Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/375.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,计算azure数据库表中的行数_Java_Android_Azure_Azure Sql Database - Fatal编程技术网

Java,计算azure数据库表中的行数

Java,计算azure数据库表中的行数,java,android,azure,azure-sql-database,Java,Android,Azure,Azure Sql Database,我正在尝试计算Azure数据库表中的行数,并在我的android应用程序上显示该行数。我在这里阅读了Azure关于从表中检索数据的文档: 但是它没有提到一个内置的计数函数。Azure库是否具有计数功能?是的,有一个名为includeTotalCount的方法将返回所有记录的计数。有关详细信息,请参考文章,正如@AlexChen Wx所说,您可以使用Azure Mobile Service JavaScript后端上ObjectMobileServiceTable的方法来计算记录数 如果您想直接

我正在尝试计算Azure数据库表中的行数,并在我的android应用程序上显示该行数。我在这里阅读了Azure关于从表中检索数据的文档:


但是它没有提到一个内置的计数函数。Azure库是否具有计数功能?

是的,有一个名为
includeTotalCount
的方法将返回所有记录的计数。有关详细信息,请参考文章

,正如@AlexChen Wx所说,您可以使用Azure Mobile Service JavaScript后端上Object
MobileServiceTable
的方法来计算记录数

如果您想直接使用Android应用程序,您可以尝试使用Java中类MobileServiceTable的方法
includeInlineCount
,请参阅位于的源代码。

boolean loop=true;
int totalrows=0;
int skipnumber=0;
int行=0;
while(循环){
int count=mToDoTable.select().skip(skipnumber.execute().get().size();
skipnumber=skipnumber+50;
行=行+计数;

如果(行)使用此选项?final MobileServiceList result=mtodTable.includeInlineCount().execute().get();@Cian是的,请尝试。它不起作用,也不起作用:final MobileServiceList result=mtodTable.where().includeInlineCount().execute().get();@Cian尝试编码
int count=result.getTotalCount()
 boolean loop = true;
 int totalrows = 0;
 int skipnumber = 0;
 int rows=0;
 while(loop) {
     int count = mToDoTable.select().skip(skipnumber).execute().get().size();
     skipnumber = skipnumber+50;
     rows = rows+count;
     if(rows<skipnumber){
           loop=false;
           totalrows = rows;
           Log.i("count",String.valueOf(totalrows));

     }
}