hi,
I have a left outer join query which gives the result in the oracle-sql-developer.
But when i try to get the results for this query using jdbctemplate it gives me a wrong ans.
My query is
This query returns 2 rows in oracle sqldeveloper but with jdbctemplate it returns 0.Code:String sqlQuery = select * from table1 t1 left outer join table2 t2 on t1.code = t2.it_code where t1.group_code = ? and t2.emp_code = ? and t1.is_active =? and t2.is_active = ? order by t1.created_on
This is how i am using the jdbctemplate.
Normal queries are working fine.But left outer join query gives wrong results.Code:jdbcTemplate.query(sqlQuery, new Object[] { groupCode, emp_code, IS_ACTIVE_FLAG,IS_ACTIVE_FLAG }, new int [] {Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,Types.VARCHAR}, new RowCallbackHandler() { @Override public void processRow(ResultSet rs) throws SQLException { map.put("count", rs.getInt(1)); } }); log.info("count is " + map.get("count"));
Please help.Where am i going wrong.
Thanks in advance.
Regards,
Annuk![]()


Reply With Quote
