1 Reply Latest reply on Aug 12, 2005 4:05 AM by Florian Kammermann

    Invalid parameter binding(s) with a declared sql statment

    Florian Kammermann Newbie

      Hello Together I have trouble with a declared sql statment.
      When I execute my Code I become following Exception:

      java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).

      Here is my Code:

      The EJB with the XDoclet tags:
      ****************************************************************
      * @jboss.declared-sql
      * signature="java.util.Collection ejbSelectByAllArguments(java.lang.String manufacturer, java.lang.String subGroup, java.lang.Long minPrice, java.lang.Long maxPrice, java.lang.String keyword, java.lang.String articleNumber)"
      * description=""
      * ejb-name="Article"
      * alias="art"
      * distinct="true"
      * from=", pricing p, articleattribute att"
      * where="
      * art.seq = att.fk_article
      * AND
      * art.seq = p.fk_article
      * AND
      * p.type = 'LI'
      * AND
      * p.valuelong > {2} AND p.valuelong < {3}
      * AND
      * art.artno in
      * ( select att.artno from articleattribute att where att.name='ManufacturerName' AND att.value LIKE '%{0}%' )
      * AND
      * art.artno in
      * ( select att.artno from articleattribute att where att.name='SubGroup' AND att.value LIKE '%{1}%' )
      * AND
      * art.artno in
      * ( select att.artno from articleattribute att where att.name='ProductDescription' AND att.value LIKE '%{4}%' )
      * AND
      * art.artno in
      * ( select art.artno from article art where art.artno LIKE '%{5}%' )
      * "

      /**
      * @ejb.select
      * query=""
      */
      public abstract java.util.Collection ejbSelectByAllArguments(java.lang.String manufacturer, java.lang.String subGroup, java.lang.Long minPrice, java.lang.Long maxPrice, java.lang.String keyword, java.lang.String articleNumber) throws FinderException;

      ***************************************************************

      The jbosscmp-jdbc.xml:
      ***************************************************************

      [CDATA[]]
      <query-method>
      <method-name>ejbSelectByAllArguments</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      <method-param>java.lang.String</method-param>
      <method-param>java.lang.Long</method-param>
      <method-param>java.lang.Long</method-param>
      <method-param>java.lang.String</method-param>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>

      <declared-sql>


      <ejb-name>[CDATA[Article]]</ejb-name>

      [CDATA[art]]

      [CDATA[, pricing p, articleattribute att]]
      [CDATA[ art.seq = att.fk_article AND art.seq = p.fk_article AND p.type = 'LI' AND p.valuelong > {2} AND p.valuelong < {3} AND art.artno in ( select att.artno from articleattribute att where att.name='ManufacturerName' AND att.value LIKE '%{0}%' ) AND art.artno in ( select att.artno from articleattribute att where att.name='SubGroup' AND att.value LIKE '%{1}%' ) AND art.artno in ( select att.artno from articleattribute att where att.name='ProductDescription' AND att.value LIKE '%{4}%' ) AND art.artno in ( select art.artno from article art where art.artno LIKE '%{5}%' ) ]]
      </declared-sql>

      ***************************************************************
      Version of jboss is 4.0.2
      Version of MSSQL-Driver is mssqlserver-1.2.2.jar

      Thanks a lot for help & Greets