title: How can I resolve “The cursor was not declared” from SQL Server
body: <p>I am connecting to SQL Server via Spring in WebSphere. I have a piece of pretty simple dynamic SQL (below) that is throwing "The cursor was not declared."</p>
  
  <pre><code>SELECT TOP 1
      short_desc shortDescription
  FROM
      product.prs.PRODUCT_SKN (nolock)
  WHERE
      prod_sales_div_code = 'XXX'
      AND product_nbr = ?
  </code></pre>
  
  <p>One of the settings for the data source that seems relevant is the "select mode" is "cursor". I'm not really sure what I need to do to resolve the error.</p>
  
  <p><em>edit</em> The calling code is:
  <code>findShortDescriptionQuery.get().findObjectByNamedParam(of("productNumber", productId))</code></p>