Given that you have a database connection to the dutch/lion test tables, you can use SquelerDDL as simple as:
SQLMetaData meta = new SQLMetaData(getConnection());
List l = meta.getTablesWithColumns(null,"DUTCH","COURSE");
if (l!=null) {
TableModel model = (TableModel) l.get(0);
TableDDL ddl = new TableDDL (model);
ddl.setAction(TableDDL.CREATE);
System.out.println(ddl.getStatement());
}
The output in (this case for Oracle) will look like:
CREATE TABLE COURSE(
ID NUMBER(9) NOT NULL,
NAME VARCHAR2(50) NOT NULL,
TEACHER NUMBER(9),
STARTDATE DATE,
ENDDATE DATE,
DAYOFWEEK NUMBER(1) NOT NULL,
STARTTIME NUMBER(4) NOT NULL,
ENDTIME NUMBER(4) NOT NULL,
ROOM NUMBER(9))
;
Another way to use it is creating your own model
ColumnDDL ddl = new ColumnDDL();
ddl.setTableName("COURSE");
ddl.setName("TEACH_ASST");
ddl.setDataType(java.sql.Types.VARCHAR);
ddl.setTypeName("VARCHAR2"); // You can look this up via SQLMetaData, if you already have a valid database connection
ddl.setColumnSize(32);
ddl.setAction(ColumnDDL.CREATE);
System.out.println(ddl.getStatement());
The output in this case for Oracle will look like:
ALTER TABLE COURSE ADD COLUMN TEACH_ASST VARCHAR2(32);