Skip to main content

Posts

Showing posts from January, 2019

How to configure a Datasource in JBoss / WildFly as a JAR Deployment

JDBC drivers can be installed as a JAR deployment using either the management CLI or the management console. As long as the driver is JDBC 4-compliant, it will automatically be recognized and installed as a JDBC driver upon deployment. 1. Download the appropriate JDBC driver from your database vendor. 2. Start the JBoss EAP/WildFly server. 3. Now most of the drivers coming with JDBC 4-compliant, but in case If the JDBC driver JAR is not JDBC 4-compliant, it can be made deployable using the following steps. i) Create a directory structure META-INF/services on your local system. $ mkdir -p META-INF/services    ii) Create a file inside META-INF/services/java.sql.Driver. $ touch META-INF/services/java.sql.Driver   iii) Add one line in the file to indicate the fully-qualified class name of the JDBC driver. $ echo “com.mysql.jdbc.Driver” > META-INF/services/java.sql.Driv...

How to configure a Datasource in JBoss / WildFly as a Module

JDBC (Java Database Connectivity) is a Java API to connect and execute the query with the database. It is a part of JavaSE (Java Standard Edition). JDBC API uses JDBC drivers to connect with the database. The JDBC driver converts the application code to the database language. This means that if the correct driver is installed, an application can be used with any supported database.  Install a JDBC Driver as a Module JDBC drivers can be installed as a core module using the management CLI using the following steps. 1. Download the appropriate JDBC driver from your database vendor. 2. Start the JBoss EAP/WildFly server. 3. Launch the management CLI with--connect argument to connect to the running instance. $ EAP_HOME/bin/jboss-cli.sh --connect And you will get the below cli [standalone@localhost:9990 /] 4. Use the module add management CLI command to add the new core module. Syntax :- module add --name=<MODULE_NAME> --resources=<PATH...