[ rubbish-db ]

ソース

RubbishDatabase dbh = new RubbishDatabase();
dbh.setLogging(true);

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

println(new TabularFormat(dbh.query("SELECT * FROM PUBLISHER ORDER BY ID")));

Publisher publisher = new Publisher("07", "御来利意書房", new Integer(2), new Date(), new Date());
publisher.save();

println(new TabularFormat(dbh.query("SELECT * FROM PUBLISHER ORDER BY ID")));

dbh.rollback();
dbh.disconnect();

結果

connect database 'url=jdbc:hsqldb:hsql://localhost, user=sa, password='.
'SELECT * FROM PUBLISHER ORDER BY ID'
+--+--------------------+-------+-----------------------+-----------------------+
|ID|NAME                |VOLUMES|UPDATE_DATE            |CREATE_DATE            |
+--+--------------------+-------+-----------------------+-----------------------+
|00|ミュンヒハウゼン出版|1      |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|01|栄学館              |4      |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|02|時源出版            |4      |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|03|曙蓬莱新聞社        |4      |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|04|太公望書林          |12     |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|05|日本曙蓬莱武術協会  |5      |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|06|民明書房            |76     |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
+--+--------------------+-------+-----------------------+-----------------------+
'INSERT INTO PUBLISHER (CREATE_DATE, ID, NAME, UPDATE_DATE, VOLUMES) VALUES (?, ?, ?, ?, ?) [2006-07-15 14:48:42.359, 07, 御来利意書房, 2006-07-15 14:48:42.359, 2]'
'SELECT * FROM PUBLISHER ORDER BY ID'
+--+--------------------+-------+-----------------------+-----------------------+
|ID|NAME                |VOLUMES|UPDATE_DATE            |CREATE_DATE            |
+--+--------------------+-------+-----------------------+-----------------------+
|00|ミュンヒハウゼン出版|1      |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|01|栄学館              |4      |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|02|時源出版            |4      |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|03|曙蓬莱新聞社        |4      |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|04|太公望書林          |12     |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|05|日本曙蓬莱武術協会  |5      |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|06|民明書房            |76     |2005-07-10 17:10:00.000|1999-07-10 17:10:00.000|
|07|御来利意書房        |2      |2006-07-15 14:48:42.359|2006-07-15 14:48:42.359|
+--+--------------------+-------+-----------------------+-----------------------+
rollback transaction.
disconnect database.