problem with java sql-query producing List return type

0
I sucessfully sql-queried over a table and logged the results from java into the mendix console with Core.getLogger(this.toString()).info(res.getString(4)); Now I want to create a List<imendixobject> type output. To this end I looped over the resultset with - while (res.next()) {... and - list.add()... How do I cast the String-type attribute of interest into the IMendixObject format? Got hard time to create a new instance of IMendixObject: - IMendixObject imx = null; - IMendixObject imx = new IMendixObject(); ("can't instantiate...") - IMendixObject imx = (IMendixObject) new Object (); failed so I can't finally use imx.setValue(getContext(), Entity1.MemberNames.Attribute3.toString(), res.getString(4)); Can anybody help me with a suggestion?
asked
1 answers
2

Use Core.create() to create mendix objects. What database are you querying by the way? Some external one?

You can also use the proxies (basically a wrapper around a mendix object) for easier access to an entity's fields (so YourEntity.create())

answered