-
May 13th, 2008, 08:54 AM
#1
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
-
May 13th, 2008, 12:29 PM
#2
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.
-
May 13th, 2008, 02:07 PM
#3
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
-
Forum Rules