I need to change the ’22-05-2024′ with a placeholder to pass dinamically the parameter and then pass the string to the searchLimit for the query. How can i do? I need to pass the parameter how argument of the method and then…?
Thank you all for the help and sorry for bad english!
I tried to change the date with ? but i don’t know if is right
private static final String QUERY_5 = "select * from ESTERO.VW_EST_MARGINI_INVIO_MIDA_Q where 1=1 AND data_riferimento = to_date('22-05-2024','dd-mm-yyyy') and UPCV_CODE = 'UCV_EDCROEETLDFI' and mercato = 'MGP' and data_invio_forecast is not null";
@Datasource(datasourceKey = EDatasourceKey.DAMASCO)
public List<UpView> searchLimit()
{
try {
long startTime = System.currentTimeMillis();
log.debug("call searchLimit(): |{}|", startTime);
StringBuilder sql = new StringBuilder(QUERY_5);
List<UpView> result = dataAccessService.search(UpView.class, sql.toString(), null, true, true);
log.info("end searchLimit(): |{}|", System.currentTimeMillis() - startTime);
if(Assorted.notNull(result)) {
return result;
}
else {
return null;
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return null;
}
New contributor
Anna Rita Patarino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.