Execute select query in Apache metamodel

243 Views Asked by At

I am using Apache meta model with postgres database. I want to execute a simple SQL select query. Can some one please help me how to achieve this functionality ??

1

There are 1 best solutions below

0
Kasper Sørensen On BEST ANSWER

Simply instantiate a JdbcDataContext and query like e.g. the MetaModel website’s example:

DataContext dataContext = new JdbcDataContext(..)(
DataSet dataSet = dataContext.query()
.from("libraries")
.select("name")
.where("language").eq("Java")
.and("enhances_data_access").eq(true)
.execute();