In this tutorial, we’ll walk through the process of deploying a WildFly datasource XML file as part of your Java EE application. WildFly, formerly known as JBoss AS (Application Server), is a popular open-source application server developed by Red Hat. A datasource XML file contains configuration details for database connections, such as database URL, username, password, and driver class.
WildFly Datasource configuration
A javax.sql.DataSource objects simplifies access to a Database by implementing classes that allow you to use connection pool.
In WildFly, the DataSource object is available in all server configurations through the datasources subsystem. Out of the box, an H2 Datasource is available for testing purposes.
You can learn more about DataSource Configuration through the following resources:
DataSource set up
How to set up a Datasource with WildFly
How to configure the DataSource Connection pool
Configuring Agroal Datasource on WildFly
Creating a Datasource using a CLI script
Creating a Datasource using the Web Console
Hardening a DataSource
How to validate Database connections in JBoss / WildFly
How to encrypt the Datasource password
Monitoring / Troubleshooting
How to trace JDBC statements with JBoss and WildFly
Solving “No managed connections available within configured blocking timeout”
Using try-with-resources to close database connections
DataSource and Enterprise applications
How to deploy a DataSource in jboss at application level
How to inject a DataSource in your Enterprise applications
Advanced topics
Configuring Datasource JTA and XA settings
How do I access the specific driver Connection with JBoss
Database specific tutorials
Configuring a PostgreSQL DataSource
Configuring MS SQLServer DataSource
Configuring a MySQL DataSource
How to solve the issue JDBCConnectionException: could not extract ResultSet
The JDBCConnectionException with the message “could not extract ResultSet” is a common exception encountered in Java applications that interact with databases. This article aims to explore the possible root causes of this exception and provide troubleshooting steps to help you resolve the issue. Root Causes of JDBCConnectionException: Could Not Extract ResultSet Troubleshooting Steps Conclusion The … Read more
WildFly Connection Pool configuration made easy
WildFly uses a pool of Database Connection objects to your applications. A Connection Pool is a way to reduce the cost of opening and closing Database connections by maintaining a Pool of Database connections. In this article we will learn how to configure WildFly Connection Pool in an optimal way.
H2 Database Tutorial and expert Tips
H2 DB is an open source lightweight Database written in Java. It ships in JBoss EAP and WildFly application server to speed up developing and testing Java applications. Let’s have a look to the main configuration options and how to create an example application using the H2 DB. What is H2 database? Firstly, let’s see … Read more
How to encrypt WildFly Datasource password
In this tutorial we will learn how to protect sensitive data such as the Datasource password in WildFly. At first, we will learn the recommended approach, using Credential Stores. Then, for older WildFly installation, we will use PicketBox to encrypt the datasource password.
How to solve “Unable to get managed connection” error
Scenario: You are unable to fetch connections from the Database and the server log shows the error “Unable to get managed connection for <DataSource>” .
How to trace JDBC Statements performance in MySQL
In this quick article we will learn an handy option which is available in MySQL JDBC Driver to debug and profile SQL statements run by Java applications.
How to configure a Datasource programmatically
This article covers how to define a Datasource resource programmatically using the DataSourceDefinition annotation. Then, we will show to to use the Datasource to connect to a Relational Database and execute SQL Statements.
What you need to know about CVE-2021-42392
H2 Console in versions between 1.1.100 and 2.0.204 is vulnerable as it allows loading of custom classes from remote servers through JNDI, like the Log4Shell vulnerability. Let’s see in detail the issue and how this can affect our environment.
H2 Database cheatsheet
Here is a cheat sheet for H2 Database which shows some common Data definition, Data modification statements, JDBC Settings and H2 Database server administration. Firstly, if you are looking for an introduction to using H2 Database in your applications, then check this tutorial: H2 database tutorial DDL cheat sheet Table Creation (Basic) CREATE TABLE TEST(ID … Read more