Home  >  Blog  >   JBoss

Configuring Enterprise Services

Rating: 4
  
 
2373

 

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

 

Join our newsletter
inbox

Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!

Course Schedule
NameDates
JBoss TrainingApr 30 to May 15View Details
JBoss TrainingMay 04 to May 19View Details
JBoss TrainingMay 07 to May 22View Details
JBoss TrainingMay 11 to May 26View Details
Last updated: 03 Apr 2023
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 more