-1
我有一個調用SQL查詢的方法。它返回一個ArrayList,所以我將它設置爲一個變量temp。我正在更改使用ResultSet不使用它的舊代碼。 我把這個:Java Arraylist <String>調用SQL查詢
if (rs.next()) {
Password = rs.getString("EncryptedPassword");
到:
for (String x : temp) {
Password = //something
我要檢索的字符串ArrayList中,並檢查是否等於「EncryptedPassword」 你能解釋如何RS。 getString的工作原理和我如何操作新代碼? 我可以使用if語句而不是foreach語句。