The transfer tool was originally designed to always show
I wanted to be able to transfer tables from another
database (Informix) on a regular basis, so I added a
patch for autotransferring to the Transfer tool.
(based on 1.7.0 version - changes in
org.hsqldb.util.Transfer and org.hsqldb.util.TransferTable
marked by START PATCH AUTOTRANSFER / END
There are two ways to run an autotransfer.
Start from the commandline with a properties-file
java org.hsqldb.util.Transfer -at sample.properties or --
The properties-file has to contain the information about
source and target DB and tables to be transferred
* For example
there's a sampletransfer.bat along with a
sample.properties and a test HSQL database (testdb1)
to try it out.
The tables are transferred to testdb2 which is
automatically created by HSQL.
run autotransfer from another java file using
sourcePasswd,String targetDriver,String targetUrl,String
where the last parameter is a Vector containing the
names of the tables, which are to be transferred.
I also added SampleTransfer.java which uses the
methods and can create a backup of HSQL-standalone
If an exception occurs during the transfer, the original
state is restored from that backup.
Finally, TestTransfer.java (org/test) is a JUnit TestCase
which tests an autotransfer between two HSQL
I've tested it with Informix and Hsql databases, but it of
course would be good if the developers had a look at it.