天天看點

資料庫查詢結果數量問題

============問題描述============

resultset res = sqlconn

.executequery("select count(*) from" + username

+ "_message");

while (res.next()) {

userutils.flag = res.getint(1);

system.out.println("userutils = " + userutils.flag);

}

  ============解決方案1============

  from這後面加個空格吧

  ============解決方案2============

  select count(*) from後面少了一個空格樣。

最新内容請見作者的github頁:http://qaseven.github.io/