I have this SQL.
select sum(distance) AS distance FROM RoadTravelTableFile where checkBoxBusiness ='1' and plate_Number = 'AAA567'"
I have seen this simple query for raw sql in the Ormlite document.
long maxUnits = orderDao.queryRawValue("select max(units) from orders");
With that example, I coded my sql like this and it works.
distance = (int) getHelper().getRoadTravelTableFileIntegerDao().queryRawValue("SELECT SUM(distance) FROM RoadTravelTableFile where checkBoxBusiness = '1' and plate_Number ='AAA567' ");
But I have a problem, How can you make the checkBoxBusiness and plate_Number value as a parameter?
Replace current values with
?
and add arguments to the queryRawValue method.