configure jboss server

Include MySQL Driver in JBoss Server

Hi Everyone,

In the past blog, you have just experienced an example use of spring

boot to be conveyed in JBoss compartment.

Presently in this blog, we will perceive how to include mysql driver in JBoss and through JNDI URL,

configuring jboss in aem is also similar concept but we recommend aem server itself powered by apche



how Spring boot gets associated with database.

Prior to going to coding part, we need scarcely any essentials to set up database with JBOSS.

Here we don't straightforwardly place database setups in spring boot

application.properties.

So we make JNDI design in JBoss and include that arrangement in spring boot

properties record to interface with database.

Instructions to include mysql driver in JBOSS and make a JNDI URL:

Out of the case, JBoss just accompanies a H2 JDBC driver. Undoubtedly, you have an alternate

database, for example, Oracle, MS SQL or MySQL. For whatever length of time that you approach JBoss,

introducing the proper JDBC driver is genuinely clear.

The benefit of introducing it into JBoss itself is:

You can uphold a particular JDBC driver rendition for the entirety of your sent applications.

In the event that any progressions required in database designs, no compelling reason to change in code base.

In the event that various situations are associated with various databases, still you can deal with the equivalent JNDI URL for every one of the conditions. So condition explicit designs are not required.

Numerous applications can likewise have the equivalent JNDI URL.AEM

So underneath are the means to introduce MySQL drivers in JBoss.

Explore to the index $JBOSS_HOME/modules/framework/layers/base

Make com/mysql/primary catalog.

Explore to primary catalog and spare MySQL JDBC driver's container there.

Fig 1: Main Directory

Make a module.xml document with the substance underneath inside the principle index.

<?xml version="1.0" encoding="UTF-8"?>

<module xmlns="urn:jboss:module:1.1" name="com.mysql">

<resources>

<resource-root path="mysql-connector-java-[VERSION]-bin.jar"/>

</resources>

<dependencies>

<module name="javax.api"/>

<module name="javax.transaction.api"/>

<module name="javax.servlet.api" optional="true"/>

</dependencies>

</module>

Access catalog $JBOSS_HOME/independent/design and open the document standalone.xml.Till mysql-connector-java-5.1.47-bin.jar,add the driver like this:

<driver name="mysql" module="com.mysql">

<driver-class>com.mysql.jdbc.Driver</driver-class>

<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource

</xa-datasource-class>

</driver>

From mysql-connector-java-6.0.2-bin.jar, the pecking order of driver classes has been changed

also, for those adaptations you have to include the beneath referenced arrangements in

standalone.xml to include a driver.

<driver name="mysql" module="com.mysql">

<driver-class>com.mysql.cj.jdbc.Driver</driver-class>

<xa-datasource-class>com.mysql.cj.jdbc.MysqlXADataSource</xa-datasource-class>

</driver>

adobe experience manager


After all the above advances, another driver will get included the JBoss Server and need to restart the JBoss Server to see the recently included driver.

Comments

Popular posts from this blog

Five new applications you have to attempt (recommended for bloggers)

Google is no longer selling its first smartphone

New sensor can sense in depth