Commit f9aa57cc by Bogdan Andjelkovic

oglasrepository findallbykorisnikid - solved

parent b14b8070
...@@ -159,11 +159,12 @@ public class OglasRepository ...@@ -159,11 +159,12 @@ public class OglasRepository
public List<Oglas> findAllByKorisnikId(int korisnikId, Integer vrstaOglasaId, Integer lokacijaId, Integer brojSoba, Double cenaMin, Double cenaMax, Double kvadraturaMin, Double kvadraturaMax, Boolean lift, Boolean grejanje, Boolean namesten) public List<Oglas> findAllByKorisnikId(int korisnikId, Integer vrstaOglasaId, Integer lokacijaId, Integer brojSoba, Double cenaMin, Double cenaMax, Double kvadraturaMin, Double kvadraturaMax, Boolean lift, Boolean grejanje, Boolean namesten)
{ {
List<Oglas> list = new ArrayList<Oglas>(); List<Oglas> list = new ArrayList<Oglas>();
String sql = "call findAllByKorisnikId(?)"; String sql = "{call findAllByKorisnikId(?)}";
ResultSet rs = null; ResultSet rs = null;
CallableStatement stmt = null; CallableStatement stmt = null;
try { try {
stmt = dataBase.connection.prepareCall(sql); stmt = dataBase.connection.prepareCall(sql);
stmt.setInt(1,korisnikId);
rs = stmt.executeQuery(); rs = stmt.executeQuery();
while( rs.next()) while( rs.next())
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment