The following methods return a ResultSetUtil object containing the records returned by the given SQL prepared statement and the list of parameters run on the given DB . In the first method, the maximum number of returned rows can be defined.
executeUsingPreparedStatement(String sqlStatement, String dbName, ArrayList<Object> parameters, String dbType, Integer maxRows)
executeUsingPreparedStatement(String sqlStatement, String dbName, ArrayList<Object> parameters, String dbType)
public ArrayList<CUSTOMCRMDORental> loadLatest(CRMDOAccountReceivable account, Integer numberOfRentals){
ArrayList<CUSTOMCRMDORental> rentals = new ArrayList<CUSTOMCRMDORental>();
ArrayList<Object> parameters = new ArrayList<Object>();
String sql ="\n SELECT RENTALID FROM TRN_RENTALS" +
"\n WHERE RENTALDELETED = 0 " +
"\n AND ACCRECID = ?"+
"\n ORDER BY RENTALCREATEDDATE" ;
parameters.add(account.getId());
ResultSetUtil rsu = SQLUtil.executeUsingPreparedStatement(sql, getOrganisationID(), parameters, getCRMSession().getDbtype(), numberOfRentals);
if(rsu!=null && rsu.next())
{
if(rsu.getString("RENTALID")!=null)
{
rentals .add((CUSTOMCRMDORental)rentalBean.load(rsu.getString("RENTALID")));
}
}
return rentals;
}