'How to get a column from a table using CDO

I need to get a column from a table using CDO. I found a solution in https://wiki.eclipse.org/Query_DB_Store_by_using_SQL

 CDOQuery query = view.createQuery("sql", "SELECT city FROM Customer");
 query.setParameter("cdoObjectQuery", false);
 List<String> cities = query.getResult();

But it's not working because I need to pass class as a parameter to getResult() like this:

List<String> cities = query.getResult(String.class);

But I get ClassNotFoundException in runtime. How can I get the column?



Solution 1:[1]

I found a solution. If I set cdoObjectQuery to false I got the above mentioned error. I just left it in its default state which is true.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ivan Seregin