String expression = CHEMICAL_REORDERPOINT + "*" + searchRequest.getReorderPercentage() + "/100)";
Before :
String expression = CHEMICAL_REORDERPOINT + "*" + searchRequest.getReorderPercentage() + "/100)";
searchRequest.getReorderPercentage()
comes dynamically from browser after submit value.
Lets take value for searchRequest.getReorderPercentage() = 50
so String expression = CHEMICAL_REORDERPOINT*50/100;
This is getting populated in a prepared statement of JDBC
in my application, so to maintain the prepare statement rule i have used in below way:
After :
String expression = CHEMICAL_REORDERPOINT + "*?)"
String str = searchRequest.getReorderPercentage() + "/100";
params.add(str)
here params is a list from which the parameters will be iterated and will be placed in postion parameters of prepare statement while executing it.
But now i m getting exception like Invalid data conversion: Parameter instance 50.0/100 is invalid for the requested conversion. ERRORCODE=-4461, SQLSTATE=42815
Pls can any one help me out. Thanks