1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| public ResultSet getLoanIndicators(int idAgency, String constraint) {
ResultSet rslt = null;
try {
String query = "SELECT first_Name_Customer,last_Name_Customer, percentage_Rate, monthly_Sim, duration_Sim,birthday_Customer, description_LoanRef, amount_Sim "
+ "FROM LoanSimulation ls, Loan l, Customer c, Agency a,Consultant ct, LoanRef lr "
+ "WHERE l.id_Sim = ls.id_Sim "
+ "AND c.id_Customer = ls.id_Customer "
+ "AND ct.id_Consultant = ls.id_Consultant "
+ "AND a.id_Agency = ct.id_Agency "
+ "AND ls.id_LoanRef = lr.id_LoanRef "
+ "AND a.id_Agency = ? ";
if (!constraint.equals("")) {
query = query + constraint;
}
PreparedStatement queryPrep = conn.prepareStatement(query);
queryPrep.setInt(1, idAgency);
ResultSet rs = queryPrep.executeQuery();
rslt= rs;
} catch (SQLException ex) {
Logger.getLogger(AccessDB.class.getName()).log(Level.SEVERE, null, ex);
}
return rslt;
} |
Partager