5 Replies Latest reply on Feb 28, 2002 1:58 PM by Dain Sundstrom

    how to take away the ' ' in the query statement?

    Kenneth Tang Newbie

      I am using JBoss-2.2.1 and MySql 3.23.43.
      I tried to put 'IN' into my query statement to optimize speed of the finder method, for example,
      " select A, B from DBT where C in (x,y,z); " instead of doing mulitiply query statements as
      " select A, B from DBT where C=x; ",
      " select A,B from DBT where C=y; "...
      In the finder method of jaws.xml, I put C in ({0}) instead of C={0}.
      I passed the parameter as a string contains "x,y,z" where C 's type is int(11) in the DB.
      In the log file of MySql, the statement becomes
      "select A, B from DBT where C in ('x,y,z');" (with the ' ' ) and the query statments return empty set.
      In the command line, I tried the same statement with the ' ' and it returned the empty set as expect. When I tried the statement without the ' ', it returned what I wanted.

      I want to ask if there is any way that I can 'notify' JBoss not to put ' ' in a particular finder method. Or, any way to take away the ' ' in the statement that MySql receives. I'll appreciate your help.