In JDBC metadata is not set, if the result set is empty, so I cannot execute getColumnNames().
I tried querying the derby systables:
The SYS.SYSTABLES table contains REFERENCEID, COLUMNAME, COLUMNUMBER, …
COLUMNAME is what I’m searching for. But I see no possibility to join this table with SYS.SYSTABLES or any other table.
You can join systables and syscolumns with
TABLEID = REFERENCEID