我試圖找到john
在name
列的數據庫,但我無法。如何在sql db中獲得結果項數量?
我試圖如下:
String st="SELECT name FROM mytable";
ResultSet rs = stmt.executeQuery(st);
int icount = 0 ;
if (rs.equals("john")) {
while (rs.next()) {
icount++;
}
}
jtext1.setText(String.valueOf(icount));
非常感謝您...... –