Scusate per la poca chiarezza. Faccio un esempio.
In alcuni casi ho solo un valore di ricerca dopo where
stmt = conn.prepareStatement("select * from clienti where cap=?");

stmt.setString(1, 95100);

In altri casi ne ho due:

stmt = conn.prepareStatement("select * from clienti where cap=?" and fatturato>?);

stmt.setString(1, 95100);

stmt.setString(2, 1.500);