Windows
Edit the standalone.xml
Replace jdbc-version-template at two locations with the jdbc version, e.g., mysql-connector-bin.jar
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
jdbc:mysql://localhost:template-db-port/ece2</connection-url>
<driver>jdbc-version-template</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
<drivers>
<driver name="jdbc-version-template" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
Replace template-db-user with the mariadb-wildfly-user, e.g., root
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>template-db-user</user-name>
<password>template-db-password</password>
Replace template-db-password with the mariadb-wildfly-user password
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>template-db-user</user-name>
<password>template-db-password</password>
</security>
Replace wildfly-template-port with the WildFly port, usually 8080
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
<socket-binding name="http" port="${jboss.http.port:wildfly-template-port}"/>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
Replace template-db-port with the database port, e.g., 3306
<Install-path>\WildFly\standalone\configuration\standalone.xml
XML
jdbc:mysql://localhost:template-db-port/ece2</connection-url>
<driver>jdbc-version-template</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>
Edit module.xml
Replace jdbc-version-template with the JDBC version, e.g., mysql-connector-bin.jar
<Install-path>\WildFly\modules\system\layers\base\com\h2database\h2\main\module.xml
XML
<module xmlns="urn:jboss:module:1.3" name="com.mysql">
<resources>
<resource-root path="jdbc-version-template"/>
</resources>
<dependencies>
Edit add-user.bat in the directory <Install-path>\WildFly\bin and replace template_path with the directory of JAVA_HOME-SED.
<Install-path>\WildFly\bin\add-user.bat
XML
set JAVA_HOME=template_path
rem -------------------------------------------------------------------------
Edit standalone.bat in the directory <Install-path>\WildFly\bin and replace template_path with the directory of JAVA_HOME-SED.
<Install-path>\WildFly\bin\standalone.bat
XML
set JAVA_HOME=template_path
rem -------------------------------------------------------------------------
Edit standalone.conf.bat in the directory <Install-path>\WildFly\bin and replace template_path with the directory of JAVA_HOME-SED.
<Install-path>\WildFly\bin\standalone.conf.bat
XML
rem set "JAVA_HOME=C:\opt\jdk1.6.0_23"
set JAVA_HOME=template_path
Create a WildFly administrator
Open console as administrator
Navigate to directory <Install-path>\WildFly\bin
Run add-user.bat
Answer questions as follows:
Set up WildFly as a service
Copy the folder service from directory <Install-path>\WildFly\docs\contrib\scripts to directory <Install-path>\WildFly\bin
In the admin console, navigate to directory <Install-path>\bin\service
Enter the command below with the corresponding variables for %wildfly-servicename%, %wildfly-ipaddr% and %wildfly-managementport%:
<Install-path>\bin\service
BASH
service.bat install /startup /name=%wildfly-servicename% /display=%wildfly-servicename% /controller=%wildfly-ipaddr%:%wildfly-managementport% /config standalone.xml
Create database
In the console, change to the directory <Install-path>\<database>\bin .
For MariaDB as the database, it is the directory <Install-path>\mariadb\bin, run the command mysql.exe -u "username" -p
Note
Here, the username and password of the database must be used.
c. Enter and execute the following commands with the corresponding variables for %mariadb-db-name%,%mariadb-wildfly-user%, %mariadb-wildfly-pw% and %host% .
XML
CREATE DATABASE %mariadb-db-name%;
GRANT ALL PRIVILEGES ON ece2.* TO %mariadb-wildfly-user%@'localhost' IDENTIFIED BY '%mariadb-wildfly-pw%';
GRANT ALL PRIVILEGES ON ece2.* TO %mariadb-wildfly-user%@'127.0.0.1' IDENTIFIED BY '%mariadb-wildfly-pw%';
GRANT ALL PRIVILEGES ON ece2.* TO %mariadb-wildfly-user%@'::1' IDENTIFIED BY '%mariadb-wildfly-pw%';
GRANT ALL PRIVILEGES ON ece2.* TO %mariadb-wildfly-user%@'%host%' IDENTIFIED BY '%mariadb-WildFly-pw%';
FLUSH PRIVILEGES;
d. Exit mysql.exe