Support > Database usage guide (R7) > Provided script
ja | en

When using an external database, you can automate table management using the script shown here. Please use the extension ". Bat" for Windows OS and the extension ". Sh" for Unix OS.

It is prepared in the wagbyapp / bin folder which is a built application.
You can test the connection with the external database by entering the following command.

> check_db.bat
For Linux, it will be check_db.sh.

The result of the command is output to check_db.txt in the same folder.Please check the contents of this file and confirm that no error occurred.

If the connection test is successful, the following database and JDBC driver information are output in check_db.txt.

...
GetDatabaseProductName = HSQL Database Engine getDatabaseProductVersion = 2.0.0 ... getDriverName = HSQL Database Engine Driver getDriverVersion = 2.0.0
...

It is prepared in the wagbyapp / bin folder which is a built application.
You can create tables and register initial data by entering the following command.

> init_db.bat
For Linux, it is init_db.sh.

When the command is executed normally, it will be displayed as follows.

Command: auto All table enabled Config file:. \ Conf \ initdb.xml Log4j Property File: default file. Import seq 11/11 at 0 sec. Process 11 at 0 sec. ... ... (omitted) import juser 2 / 2 at 0 sec. Process 2 at 0 sec. ...
When using the built-in database, this script is executed as part of the build process.Therefore, data is initialized every time it builds.When using external database, this process is done manually.

It is prepared in the wagbyapp / bin folder which is a built application.
You can export the value of the current table (output as an external file) by entering the following command.

> export_db.bat ..\..\export\data_xxxx
For the folder name, prefix "data_".
For Linux, it is export_db.sh.

The output destination is under the $ (APPHOME) / export folder.

When using Windows OS, this batch file can not be executed by double clicking (from File Explorer).This is because you need to specify "target folder" as a command line argument.

It is prepared in the wagbyapp / bin folder which is a built application.
Delete the data (related to Wagby) and table definition on the external database by entering the following command.

> drop_db.bat
For Linux, it is drop_db.sh.

It is available in $ (APPHOME) / bin folder.
By entering the following command, you can create a table and load a set of data in the export folder to an external database.

> import_db.bat ..\..\export\data_xxxx
For Linux, it is import_db.sh.
When using Windows OS, this batch file can not be executed by double clicking (from File Explorer).This is because you need to specify "target folder" as a command line argument.

When the data size to be handled is huge

When executing each script, "Out Of Memory" error message may be displayed.In this case, it corresponds as follows.

  1. Open the script file with a text editor.
  2. There is a part where the memory size is specified with the notation of -Xmx in the script file.
    -Xmx512m
    The standard is "512 m" (512 Mbyte).Increase this value and save the file.(An example is 1024 m.)
  3. After editing, execute the script file again.