I am facing issue during the database query call and receiving below mentioned error. Facing this issue when running the code in local. Code base is setup in Java 1.7 and Ant Build.
ERROR: java.sql.SQLException: Wrong number of parameters: expected 0, was given 5 Query:
{call dbo.SaveTest(?,?,?,?,?)} Parameters: [value1, value2, value3, value4, value5]
Code:
QueryRunner run = new QueryRunner(ContextListener.getDataSource());
BigDecimal result = run.query("{call dbo.SaveTest(?,?,?,?,?)}", new ScalarHandler<BigDecimal>(), mapping2,
mapping3, mapping4, mapping5);
Any help is appreciated on the issue.