0

I am getting the following error stack when I run my application :

java.lang.IllegalArgumentException: count parameter must be greater than zero
at myApplication.util.StatementUtil.expand(StatementUtil.java:83)
at myApplication.GetBananasByIdsQuery.getSQL(GetBananasByIds.java:49)
at myApplication.Query.executeQuery(Query.java:87)
at myApplication.BananasServiceJDBCImpl.get(BananasServiceJDBCImpl.java:181)
at myApplication.BananasResource.queryForBananas(BananasResource.java:127)

Here is the part of the code in BananasServiceJDBCImpl.get() the error comes from :

List<BananasDataReply> requestedBananas = new GetBananasByNamesQuery(names).executeQuery();

So, my problem is not the error itself but why I get the error where I get it. In my application, Query is extended by many classes like GetBananasByNamesQuery or GetBananasByIdsQuery and they all extend the getSQL method. Why is GetBananasByIdsQuery.getSQL when I am using a GetBananasByNamesQuery object ? Is it possible that the application is "choosing" the wrong child class at runtime ? Or is there some other problem that I can't see ?

3
  • 1
    Show us your GetBananasByNamesQuery class
    – Jayamohan
    Feb 12, 2013 at 10:26
  • 1
    GetBananasByNamesQuery extends GetBananasByIdsQuery should explain it. Feb 12, 2013 at 10:27
  • If your GetBananasByNamesQuery doesn't override getSQL() it is possible
    – Alexey A.
    Feb 12, 2013 at 10:29

1 Answer 1

0

I suspect that the SQL function count is used in the precompiled statement and obtains the zero or negative argument.

This is most likely caused by setting the wrong value for some parameter, while potentially it may be error also in the same SQL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.