I am optimizing database usage on ibatis SQL queries. I have a situation where the query results many entries but only one of them is needed. QueryForList
gives too much extra information through the slow connection and QueryForObject
is not working if result is not unique. How I should do this?
I don't wanna use the list.get(0)
with QueryForList
if I just can omit transfering the unnecessary data.
You can limit result set to only one row by adding 'LIMIT 1' to your sql query.