db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak" <tom...@gmail.com>
Subject Re: Export schema to DDL using Java not Ant
Date Tue, 11 Dec 2007 05:14:58 GMT
On Dec 10, 2007 8:38 PM, John Baker <John.Baker@sun.com> wrote:

> I'd like to export an instance of ResultSetMetaData as DDL in the same
> format as produced by
> DatabaseToDdlTask, except using Java.
> I can write my own, but I wonder if there's some example already available

The easiest way to achieve this is probably to create a subclass of
JdbcModelReader (or the database specific subclass if this is a
platform supported by DdlUtils), and override readTables to suit your
needs. You could try to creating a subclass of DatabaseMetadataWrapper
that wraps around your ResultSetMetaData object if it exposes enough
You should be aware however that databases not always expose all
necessary data via the meta data objects. In these cases, DdlUtils
queries system tables to gather additional info.


View raw message