This has nothing to do with QueryRunner and everything to do with how your JDBC driver handles in clauses and ? replacement parameters. In my experience the support is fairly poor across several drivers.
QueryRunner doesn't do any magic, it just passes the sql and parameters to a PreparedStatement. So, if you can't do it with a PreparedStatement you can't do it with QueryRunner. David --- "Marc Esher (4-2060)" <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm trying to use QueryRunner to run an in() statement and I'm having > trouble. > > > > I can't find anything in the javadocs about how to do this, and I'm not > familiar enough with prepared statements in general to intelligently > figure this out. > > > > I'm determining dynamically whether I want to use an "=" statement or an > in() statement depending on the number of parameters passed to my > method. > > > > Let's say it's like this: > > > > String select = "Select * from table where " ; > > > > If params.length ==1 > > whereClause= " myIDfield=?" > > else > > whereClause=" myIDField IN(?)" > > > > String sql = select + where; > > > > I then pass a string as my input parameter to queryrunner. This works > fine when there's just one parameter and I'm using "=", but if I use > IN(), I get an error. > > > > My sql is evaluating to "select * from table where myIDField IN(1,3)", > but query runner doesn't like it because it can't convert "1,3" to an > int. > > > > So the question is, 1) is there an easier way to do this that I'm > missing? 2) if not, then how do I accomplish this task? Do I need to > use separate ? for each parameter in my in statement? > > > > Thanks a million! > > > > Marc > > _______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]