[ rubbish-db ]

ソース

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

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

int rows = dbh.update("UPDATE PUBLISHER SET NAME=?, VOLUMES=?, UPDATE_DATE=?", "○○○○○", new Integer(9990), new Date());
println("rows=" + rows);

Map[] publishers = dbh.query("SELECT * FROM PUBLISHER ORDER BY ID");

for (int i = 0; i < publishers.length; i++)
    println(publishers[i]);

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

結果

connect database 'url=jdbc:hsqldb:hsql://localhost, user=sa, password='.
'UPDATE PUBLISHER SET NAME=?, VOLUMES=?, UPDATE_DATE=? [○○○○○, 9990, 2005-09-19 03:27:07.065]'
rows=7
'SELECT * FROM PUBLISHER ORDER BY ID'
{ID=00, NAME=○○○○○, VOLUMES=9990, UPDATE_DATE=2005-09-19 03:27:07.065, CREATE_DATE=1999-07-10 17:10:00.000}
{ID=01, NAME=○○○○○, VOLUMES=9990, UPDATE_DATE=2005-09-19 03:27:07.065, CREATE_DATE=1999-07-10 17:10:00.000}
{ID=02, NAME=○○○○○, VOLUMES=9990, UPDATE_DATE=2005-09-19 03:27:07.065, CREATE_DATE=1999-07-10 17:10:00.000}
{ID=03, NAME=○○○○○, VOLUMES=9990, UPDATE_DATE=2005-09-19 03:27:07.065, CREATE_DATE=1999-07-10 17:10:00.000}
{ID=04, NAME=○○○○○, VOLUMES=9990, UPDATE_DATE=2005-09-19 03:27:07.065, CREATE_DATE=1999-07-10 17:10:00.000}
{ID=05, NAME=○○○○○, VOLUMES=9990, UPDATE_DATE=2005-09-19 03:27:07.065, CREATE_DATE=1999-07-10 17:10:00.000}
{ID=06, NAME=○○○○○, VOLUMES=9990, UPDATE_DATE=2005-09-19 03:27:07.065, CREATE_DATE=1999-07-10 17:10:00.000}
rollback transaction.
disconnect database.