Results 1 to 3 of 3

Thread: queryForList

  1. #1
    Join Date
    May 2008
    Posts
    1

    Default queryForList

    Hello

    When I am using the method jdbcTemplate.queryForList(String query) using this SQL


    select ELEMENT_ID, BANDWIDTH, LATENCY, REACHABILITY from NHV_104052_S where element_id in ( '1000471', '1001147') AND FORMATTED_SAMPLE_TIME > sysdate - (5/1440)

    I don't get any results back yet in DBVisualizer the above SQL works fine.

    Also I am under the impression that I can not use a prepared statement with the 'in' clause is this correct?

    Thanks

  2. #2
    Join Date
    Dec 2006
    Posts
    311

    Default

    From the docs:

    public List queryForList(String sql)
    throws DataAccessException

    "Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForList method with null as argument array. "

    Anyway, you should be able to use your in clause just fine like this:

    "select ELEMENT_ID, BANDWIDTH, LATENCY, REACHABILITY from NHV_104052_S where element_id in ( '1000471', '1001147') "

    I bet your having a date formating problem. Try removing the date clause and see if you get results.

  3. #3

    Default

    In clauses work without issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •