0

My Java class do a mysql query and it's result is stored in result list.

In the attached image you can see the structure data of one element of the list result. enter image description here My question is: how can I parse each element? How can I access to these values?

I don't want to use Object type.

String queryString = "SELECT COUNT(*),tabid FROM occurrencesnames group by tabid";
Query query = session.createSQLQuery(queryString);
List result = query.list();

Thank you so much.

1 Answer 1

0

Solved!

String queryString = "SELECT COUNT(*),tabid FROM occurrencesnames group by tabid";
Query query = session.createSQLQuery(queryString);
List result = query.list();
Object[] row = (Object[]) result.get(0);
String name = (String)row[1];
1
  • 1
    Your answer has shown up in the low quality posts queue because there is no description of the code. In general, explaining your code adds value to your answer. Commented Oct 2, 2014 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.