openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <daryl.stu...@opentempo.com>
Subject Re: java.lang.IllegalArgumentException: no-named-params
Date Fri, 21 May 2010 18:51:42 GMT
On Fri, May 21, 2010 at 1:32 PM, C N Davies <cnd@cndavies.com> wrote:

> Avoidance of NPE :)
>
> String.format("SELECT id FROM %s WHERE name like '%s')", "monkey", "doo")
>
> I'm stumped.
>
> At first I was trying to be funny, but then I realized I actually don't
know how to solve the problem (how write a LIKE pattern with % without it
breaking String.format()). I don't use String.format() at all. The query is
supposed to match Monkeys that have names that end with "doo". Two % signs
don't form the right string.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
http://www.opentempo.com
mailto:daryl.stultz@opentempo.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message