Im currently accessing an embedded H2 database in java using jOOQ to generate table classes etc. I can currently execute queries such as
create.select().from(TEST).fetch()
in my code, return results etc.
However I cant query the information schema. I can access it ok using the H2 console, and creating a view for a given information_schema table works fine. My question is how should I be accessing the information_schema eg to perform a query such as
SELECT * FROM INFORMATION_SCHEMA.TABLES
from within my java code? Do I have to create a view, can the schema be accessed through jooq-meta or some other means, or do I need to add something to the property file used by jooq-codegen (information_schema isn't created in the generated tables classes)? Or something else?
Edit: This is my first foray into using jooq and am coming from a MySQL background. What I'm effectively trying to achieve is to be able to run some unit tests to ensure DB related code works. So I want to access the database's metadata (schema) and return something without having to know if any user created tables exist.