Hi Dejan,

You have several options. For instance, you could use the generated
classes from jOOQ-meta (or generate the information_schema yourself),
and then write:

    Factory create = new Factory(connection, dialect);
    String[] array =
    create.selectDistinct(TABLES.TABLE_SCHEMA)
         .from(TABLES)
         .fetchArray(TABLES.TABLE_SCHEMA);

The same can be achieved through plain SQL, of course:

    String[] array =
    create.selectDistinct(field("table_schema"))
         .from("tables")
         .fetchArray(0, String.class);

Another option would be to read from JDBC's DatabaseMetaData:

    Connection connection = ...;
    DatabaseMetaData meta = connection.getMetaData();
    String[] array = create.fetch(meta.getSchemas()).intoArray(0, String.class);

In jOOQ 3.0, you will also be able to read the meta data through the jOOQ API:

    List<Schema> schemas = create.meta().getSchemas();

Cheers
Lukas

2012/11/29 Dejan Deskoski <[email protected]>:
> something like this: select distinct(table_schema) from
> information_schema.tables, but without calling create.execute.
> The result i should get is string array of all databases

Reply via email to