Commit 9acc86f5 by Bogdan Andjelkovic

obrisani souti

parent 2bbbc39c
...@@ -24,7 +24,6 @@ public class KorisnikRepository ...@@ -24,7 +24,6 @@ public class KorisnikRepository
{ {
try { try {
String slika = Base64.getEncoder().encodeToString(multipartFile.getBytes()); String slika = Base64.getEncoder().encodeToString(multipartFile.getBytes());
System.out.println(slika.length());
String sql = "insert into korisnik( ime, prezime, telefon, email, sifra, tipId, slika, gradid, enabled) values('"+korisnik.getIme()+"','"+korisnik.getPrezime()+"','"+korisnik.getTelefon()+"','"+korisnik.getEmail()+"','"+new BCryptPasswordEncoder().encode(korisnik.getSifra())+"',1, '"+ slika +"', "+korisnik.getGradId()+",false)"; String sql = "insert into korisnik( ime, prezime, telefon, email, sifra, tipId, slika, gradid, enabled) values('"+korisnik.getIme()+"','"+korisnik.getPrezime()+"','"+korisnik.getTelefon()+"','"+korisnik.getEmail()+"','"+new BCryptPasswordEncoder().encode(korisnik.getSifra())+"',1, '"+ slika +"', "+korisnik.getGradId()+",false)";
dataBase.statement.executeUpdate( sql); dataBase.statement.executeUpdate( sql);
} catch (IOException e) { } catch (IOException e) {
...@@ -121,19 +120,6 @@ public class KorisnikRepository ...@@ -121,19 +120,6 @@ public class KorisnikRepository
public List<Korisnik> findAll() public List<Korisnik> findAll()
{ {
/*String sql = "select * from korisnik where TipID = 1";
List<Korisnik> list = new ArrayList<Korisnik>();
ResultSet rs = null;
try {
rs = dataBase.statement.executeQuery(sql);
while (rs.next()) {
list.add( new Korisnik( rs.getInt("korisnikId"), rs.getString("ime"), rs.getString("prezime"), rs.getString("email"), rs.getString("sifra"), rs.getString("telefon"), rs.getString("slika"), rs.getInt("tipid"), rs.getInt("gradid"), rs.getBoolean("enabled")));
}
return list;
}
catch (SQLException e) {
throw new RuntimeException(e);
}*/
CallableStatement stmt = null; CallableStatement stmt = null;
ResultSet rs = null; ResultSet rs = null;
try { try {
......
...@@ -69,7 +69,6 @@ public class OglasRepository ...@@ -69,7 +69,6 @@ public class OglasRepository
while( rs.next()) while( rs.next())
{ {
Oglas oglas = new Oglas( rs.getInt("oglasId"), rs.getInt("korisnikId"), rs.getString("naslov"),rs.getString("opis"),rs.getInt("lokacijaId"),rs.getDouble("cena"),rs.getInt("vrstaOglasaId"),rs.getDouble("kvadratura"),rs.getInt("brojSoba"),rs.getBoolean("namesten"),rs.getBoolean("grejanje"),rs.getBoolean("lift"),rs.getString("lokacija")); Oglas oglas = new Oglas( rs.getInt("oglasId"), rs.getInt("korisnikId"), rs.getString("naslov"),rs.getString("opis"),rs.getInt("lokacijaId"),rs.getDouble("cena"),rs.getInt("vrstaOglasaId"),rs.getDouble("kvadratura"),rs.getInt("brojSoba"),rs.getBoolean("namesten"),rs.getBoolean("grejanje"),rs.getBoolean("lift"),rs.getString("lokacija"));
//System.out.println( oglas.toString());
list.add( oglas); list.add( oglas);
} }
} catch (SQLException e) { } catch (SQLException e) {
...@@ -87,7 +86,6 @@ public class OglasRepository ...@@ -87,7 +86,6 @@ public class OglasRepository
while( rs.next()) while( rs.next())
{ {
Oglas oglas = new Oglas( rs.getInt("oglasId"), rs.getInt("korisnikId"), rs.getString("naslov"),rs.getString("opis"),rs.getInt("lokacijaId"),rs.getDouble("cena"),rs.getInt("vrstaOglasaId"),rs.getDouble("kvadratura"),rs.getInt("brojSoba"),rs.getBoolean("namesten"),rs.getBoolean("grejanje"),rs.getBoolean("lift"),rs.getString("lokacija")); Oglas oglas = new Oglas( rs.getInt("oglasId"), rs.getInt("korisnikId"), rs.getString("naslov"),rs.getString("opis"),rs.getInt("lokacijaId"),rs.getDouble("cena"),rs.getInt("vrstaOglasaId"),rs.getDouble("kvadratura"),rs.getInt("brojSoba"),rs.getBoolean("namesten"),rs.getBoolean("grejanje"),rs.getBoolean("lift"),rs.getString("lokacija"));
System.out.println( oglas.toString());
return oglas; return oglas;
} }
} catch (SQLException e) { } catch (SQLException e) {
......
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