I will explain the details of the InitLoader command to import / export. By learning various options of InitLoader, you can control more finely.

Each command described on the previous pageI call a program called InitLoader internally.InitLoader is a program dedicated to controlling input / output between XML file and database.

Java - jar InitLoader.jar [processing method] [processing target] [option]

When using built-in database (HSQLDB)

When running java, specify catalina.home with the -D option.

Java - Dcatalina.home = ".." - jar InitLoader.jar [Processing method] [Processing target] [Option]

Here is the option list of the InitLoader command.

Processing method auto It executes the create and import processes in order.
create Create a table in the database to store model data.
driver Display information of JDBC driver.
driver_all Display information of JDBC driver.
drop Delete the table for storing model data from the database. At this time, the stored data is deleted at the same time.
export It outputs data of the model stored in the database as XML format data to the file.
import Register the data saved in XML format in the database.
sequence Execute the CREATE SEQUENCE statement written in the configuration file.
sql Execute the SQL statement written in the configuration file.
update Updates the data of the model stored in the database using the data saved in the XML format.
Processing object -all Target of processing is all models.
-t [table name ...] We treat only the specified model (table) as the target of processing. Multiple table names can be specified at the same time, separated by spaces.
-g [group name] Treat the specified group as the processing target.(*)
option -c Specify the setting file of InitLoader.If not specified, it will be. / Conf / initdb.xml as the configuration file.
-d When executing the export processing, specify a folder to output XML format data.If not specified, output to the folder where InitLoader was executed.
-e Specify the encoding of the XML file output when executing export processing.If not specified, it will be Shift_JIS.
-l Specify the log4j property file to be used by InitLoader.If not specified, WEB-INF / classes / initdb.properties is the setting file.
-check_exists_table Specify true or false as an argument.It checks the existence of the table and suppresses the CREATE TABLE statement if it exists.(The target of this option is currently the master model only.)
-convert_from_old Specify true or false as an argument.When this option is specified, the one specified in the directory / @ convertimportxslfilename attribute is used as the filter XSLT file at the time of import.
-ddlfile_charenc Specify the character encoding as an argument.It becomes the character encoding of the output DDL file.
group nameIs described in the configuration file (initdb.xml).

The current directory to execute the next command is wagbyapp \ bin.

Manipulate specific models (tables)

A specific model (table) can be targeted by using the -t option of the InitLoader command.

Java - jar InitLoader.jar [command] -t [table name] -c ..\webapps\wagby\WEB-INF\export\conf\initdb.xml

Create a model (table)

To create a model (corresponding table), use the "create" command.

java -jar InitLoader.jar Create -t ​​[table name] -c ..\webapps\wagby\WEB-INF\export\conf\initdb.xml

To create all the tables at once, specify -all instead of -t.

java -jar InitLoader.jar create -all -c ..\webapps\wagby\WEB-INF\export\conf\initdb.xml

Delete model (table)

To delete the model (corresponding table), use the "drop" command.

java -jar InitLoader.jar Drop - t [table name] -c ..\webapps\wagby\WEB-INF\export\conf\initdb.xml

To create all the tables at once, specify -all instead of -t.

java -jar InitLoader.jar drop -all -c ..\webapps\wagby\WEB-INF\export\conf\initdb.xml

Do not initialize model (table) and do import process only

If you do not initialize the model (table corresponding to it) but only import process, use the "import" command.

java -jar InitLoader.jar Import -t [table name] -c .. \ webapps \ wagby \ WEB-INF \ export \ conf \ initdb.xml -d [export folder]

To process all tables at once, specify -all instead of -t.

java -jar InitLoader.jar import -all -c .. \ webapps \ wagby \ WEB-INF \ export \ conf \ initdb.xml -d [export folder]