数组已经初始化但仍然需要数组,但是找到了int#34;

时间:2016-02-11 13:49:43

标签: java

count = 0;
String s5 = "Select count(username) from login;";
ResultSet rs = stmt.executeQuery(s5);

while(rs.next()) {
  count=rs.getInt(1);
}

int num[] = new int[count];
String s3 = "Select username from login;";
ResultSet rs2 = stmt.executeQuery(s3);

while(rs2.next()) {
  String user=rs2.getString(1);
  for(i=0 ; i<count ; i++) {
    count[i] = user;
  }
}

1 个答案:

答案 0 :(得分:5)

sizeof...是一个数组。 auto my_lambda = [](auto&&... unused) { (void) sizeof...(unused); return 42; }; 不是。将{table.IDField} = previous({table.IDField}) 更改为

num

另外,存储count需要是count[i]=user;的数组。

num[i] = user;