How do you access the value of an SQL count () query in a Java program

前端 未结 7 1216
梦毁少年i
梦毁少年i 2021-02-01 00:54

I want to get to the value I am finding using the COUNT command of SQL. Normally I enter the column name I want to access into the getInt() getString() method, what do I do in t

7条回答
  •  情深已故
    2021-02-01 00:57

    The answers provided by Bohzo and Brabster will obviously work, but you could also just use:

    rs3.getInt(1);
    

    to get the value in the first, and in your case, only column.

提交回复
热议问题