I have query from MySQl
String sqlSearch = "SELECT * from Item"
and method with ArrayList
public static ArrayList<String> checkNo() throws SQLException {
ArrayList<String> no= new ArrayList<String>();
DbManager db = new DbManager();
db.connect();
String sql = "SELECT * from Category where id = " + idUser + " ";
Statement stmt = db.connect().createStatement();
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
no.add(rs.getString("nameCategory"));
}
db.disconnect();
return no;
}
And I get from specific user his category in arraylist, but how to pass this category to sqlSearch???
SELECT * from Item where category ????
data from ArrayList
Any idea?