Listify/Lambdas/Lists/ItemSearch/src/ItemSearch.java
NMerz 68051fdaca Item Search V1
Still needs testing.
2020-10-05 22:54:43 -04:00

30 lines
657 B
Java

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
public class ItemSearch {
ArrayList<Item> results;
ItemSearch(ResultSet searchResults) throws SQLException {
results = new ArrayList<>();
while (searchResults.next()) {
results.add(new Item(searchResults));
}
}
@Override
public String toString() {
return "ItemSearch{" +
"results=" + results +
'}';
}
public ArrayList<Item> getResults() {
return results;
}
public void setResults(ArrayList<Item> results) {
this.results = results;
}
}