'MappingSqlQuery pass parameter

String sql = select * from APPLICATION_LABELS where DATE_MODIFIED > '"+ new SimpleDateFormat("dd-MMM-yy").format(lastUpdate) +"'");
        
MappingSqlQuery<Object> query1 = new MappingSqlQuery<Object>(dataSource,                    sql) {
      protected Object mapRow(ResultSet result, int rowNum) throws SQLException {
        if (Integer.parseInt(result.getString(CODE)) > 0)
            table1Change = true;
        return null;
      }
 };
            query1.compile();
            query1.execute();

DATE_MODIFIED is hardcoded need to pass from parameter like setParameter in hibernate eg either ? or namedparameter :datemodified.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source