Support > Repository > Environment > Database

I will explain how to change the database used by Wagby.

Select "Database" from the "Environment" menu.

Figure 1 Setting up the database


You can select one from the following databases.(You can not select multiple databases.)

  • HSQLDB (embedded database) Only Wagby included version can not be changed
  • PostgreSQL
  • Oracle
  • SQLServer
  • DB2
  • DB2 AS/400
  • MySQL
  • DBMaker

Available database versions are "Environment> Production operation serverPlease refer to the page of.

In Wagby, databases other than HSQLDB are called "external databases".When using an external database, it is necessary to prepare "JDBC driver file" corresponding to that database.For details, please read "Support> Database utilization guide> Connection procedure> Deployment of JDBC driver".

Connection URL

Specify the URL to connect to the relational database. The URL format differs depending on the selected relational database. For details, please read "Support> Database utilization guide> Connection procedure> Database setting in WagbyDesigner".

User name

Specify the user name prepared on the relational database side. Please create a user in advance on the database side.


Specify the password corresponding to the user name prepared on the relational database to be used. Please set the user's password beforehand on the database side.

Character encoding

You can specify the character code of the external database.The standard is UTF-8.

This value is free input form.Please post the specified character code when creating the external database to use.

Identifier delimiter

Wagby is standard, and it sets up the delimiter of the identifier in the SQL sentence.

Therefore, when using the table created by Wagby (using an external system etc.) using SQL statements, it is necessary to give a delimiter to the table name and column name.For example, it becomes as follows.

select * from "juser" where "id" > 0

You can change this setting to "Do not specify delimiter".
In this case, for model ID and model item IDUnavailable patterns are generatedWe need to pay particular attention to it. For details, please read "Support> Database utilization guide> [Technical materials] Identifier delimiter in SQL statement".

In HSQLDB (embedded database), identifier delimiter characters can not be specified.

Depending on the database to be used, table creation may fail when setting delimiter is not specified. This is because the reserved word in the database was used for the column name (table). In such a case, specify the physical name of the column that caused the error and avoid it.

Enable database automatic reconnection

When restarting the external database used by Wagby, you also need to restart the application (wagbyapp) built with Wagby.

When this setting is enabled, connection confirmation processing will be performed every time it queries the database.Restarting the application is unnecessary.

This setting is not applicable when using the built-in database.

When this setting is made, the performance of the system is slightly reduced due to the connection confirmation processing.If restart processing of the external database does not seem to occur frequently, this setting isIt is recommended not to applyTo do.
This setting does not correspond to the pattern "start up the database after launching the Wagby application".The Wagby application will make a database connection at startup, but if the first connection fails (hereinafter the database will recover) it will not work.

Maximum number of connections

Sets the maximum number of virtual "connections (connections)" used for communication between the application and the database. This connection is reused by multiple users (Web browsers).The initial value is "24".Please specify a number greater than 1.

For example, when Wagby's simultaneous authentication connection number is 100, up to 100 users log on.Here, if the maximum number of connections is 24, 100 users will use 24 virtual lines.Adjusting this number according to the number of simultaneous authentication connections of Wagby improves performance.

If you specify -1 for this value, it becomes "unlimited".If you change this number, you may need to change the setting on the database side (specification of the maximum number of connections accepted) accordingly.For details, please read the external database manual to be used.

If "maximum number of connections to database" is small, a database connection error may occur during operation.Be careful when setting below initial value 24.

Maximum number of unused connections

Specify the maximum number of connections that are in an unused state.When 0 is specified, it becomes "unlimited".The initial value is "8".

Maximum wait time

Specify the wait time before the next user can use it after the connection is used by a certain user.If you specify "-1" it will be unlimited (waiting forever).The unit is millisecond.The initial value is "2000 milliseconds".

If you want to change the setting of the production machine that is already in operation, please edit the setting file referring to the following explanation.

Configuration Corresponding configuration file Setting location
Connection URL wagbyapp\conf\server.xml Resource/@name = url attribute of "jdbc/jfc" element
User name wagbyapp\conf\server.xml Resource/@name = "username attribute of" jdbc/jfc "element
password wagbyapp\conf\server.xml Resource/@name = "password attribute of" jdbc/jfc "element
Maximum number of connections wagbyapp\conf\server.xml Resource/@name = maxActive attribute of "jdbc/jfc" element
Maximum number of unused connections wagbyapp\conf\server.xml The maxIdle attribute of the Resource/@name = "jdbc/jfc" element
Maximum wait time wagbyapp\conf\server.xml Resource/@name = "maxWait" attribute of "jdbc/jfc" element

When using external database, please read notes on usage in each database.
For example, in the case of DB2, you may need to do additional work such as changing the table space/page size or individually defining the type of each model item.

"Database environment> maximum number of connections" is managed using technology called connection pooling. Standards uses Commons DBCP.

  • Wagby does the process of acquiring the connection from the connection pool.The above connection pool mechanism performs connection and release of the connection.
  • Commons DBCP is a rule "If there is no free connection in the pool, create a new connection and return."

For details, please read "Database Utilization Guide> Connection Pooling".