[ rubbish-db ]

ソース

RubbishDatabase dbh = new RubbishDatabase();
dbh.connect("jdbc:hsqldb:hsql://localhost", "sa", "");

dbh.execute("CREATE TABLE HOGE (FOO CHAR(256) NOT NULL, BAR VARCHAR(256) NOT NULL)");
dbh.execute("ALTER TABLE HOGE ADD CONSTRAINT PK_HOGE PRIMARY KEY (FOO)");
println(new TabularFormat(dbh.getColumns("HOGE")));
dbh.execute("DROP TABLE HOGE");
println(new TabularFormat(dbh.getColumns("HOGE")));

dbh.disconnect();

結果

+---------+-----------+----------+-----------+---------+---------+-----------+-------------+--------------+--------------+--------+-------+----------+-------------+----------------+-----------------+----------------+-----------+------------+------------+-----------+----------------+--------+
|TABLE_CAT|TABLE_SCHEM|TABLE_NAME|COLUMN_NAME|DATA_TYPE|TYPE_NAME|COLUMN_SIZE|BUFFER_LENGTH|DECIMAL_DIGITS|NUM_PREC_RADIX|NULLABLE|REMARKS|COLUMN_DEF|SQL_DATA_TYPE|SQL_DATETIME_SUB|CHAR_OCTET_LENGTH|ORDINAL_POSITION|IS_NULLABLE|SCOPE_CATLOG|SCOPE_SCHEMA|SCOPE_TABLE|SOURCE_DATA_TYPE|TYPE_SUB|
+---------+-----------+----------+-----------+---------+---------+-----------+-------------+--------------+--------------+--------+-------+----------+-------------+----------------+-----------------+----------------+-----------+------------+------------+-----------+----------------+--------+
|         |PUBLIC     |HOGE      |FOO        |1        |CHAR     |256        |512          |              |              |0       |       |          |1            |                |512              |1               |NO         |            |            |           |                |1       |
|         |PUBLIC     |HOGE      |BAR        |12       |VARCHAR  |256        |512          |              |              |0       |       |          |12           |                |512              |2               |NO         |            |            |           |                |1       |
+---------+-----------+----------+-----------+---------+---------+-----------+-------------+--------------+--------------+--------+-------+----------+-------------+----------------+-----------------+----------------+-----------+------------+------------+-----------+----------------+--------+
Empty set