Hurry! 20% Off Ends SoonRegister Now

Configuring Enterprise Services

 

This chapter completes the configuration of the application server, by adding a comprehensive description of the Java Enterprise services that can be run on top of the application server. Each service itself is a core subsystem, which can be included or removed, depending on the kind of applications you are delivering. Here, we will describe the most interesting ones, which have been increasingly adopted by the application server end-users, going in the following order of topics:

  • Configure the database connectivity
  • Configure the enterprise Java Bean container
  • Configure the messaging service
  • Configure the transaction service
Configuring Enterprise Services

Configuring database connectivity

In any application server, you can configure database connectivity by adding datasources to your server configuration.

Inclined to build a profession as JBOSS Developer? Then here is the blog post on JBOSS TRAINING ONLINE.

Each datasource contains a pool of database connections that are reserved as soon as the server is started up. Applications acquire a database connection from the datasource by looking it up on the JNDI tree and then calling getConnection().

Connection result = null;
try {
Context initialContext = new
InitialContext();
DataSource datasource = (DataSource)initialContext.lookup(“java:/MySqlDS”);
result = datasource.getConnection();
} catch ( Exception ex )
{   log(“Cannot get connection: ” + ex);
}

Once the connection is established, the application should call connection.close() as early as possible, which returns the database connection to the pool for other applications to use.

MindMajix Youtube Channel

Earlier JBoss AS releases needed a well-known datasource configuration file (ending in –ds.xml), which had to be deployed in order to be used by applications. Since the release 7 of JBoss AS, you need to use a different approach, because of the modular nature of the application server.

Out of the box, the application server ships with the H2 open source database engine (HTTP://WWW.H2DATABASE.COM), which can be used for testing purposes because of its small footprint and its useful browser-based console.

However, a real world application requires an industry standard database, such as Oracle database or MySQL. In the following section, we will show how to configure a datasource for the MySQL database.

Basically, any database configuration requires a two-step procedure:

 

Frequently asked Jboss Interview Questions

 

Job Support Program

Online Work Support for your on-job roles.

jobservice

Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:

  • Pay Per Hour
  • Pay Per Week
  • Monthly
Learn MoreGet Job Support
Course Schedule
NameDates
JBoss TrainingDec 24 to Jan 08View Details
JBoss TrainingDec 28 to Jan 12View Details
JBoss TrainingDec 31 to Jan 15View Details
JBoss TrainingJan 04 to Jan 19View Details
Last updated: 27 Sep 2024
About Author

I am Ruchitha, working as a content writer for MindMajix technologies. My writings focus on the latest technical software, tutorials, and innovations. I am also into research about AI and Neuromarketing. I am a media post-graduate from BCU – Birmingham, UK. Before, my writings focused on business articles on digital marketing and social media. You can connect with me on LinkedIn.

read less