May 13th, 2008, 08:54 AM
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?
May 13th, 2008, 12:29 PM
From the docs:
public List queryForList(String sql)
"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
In clauses work without issue.