Using try-with-resources to close database connections

This tutorial shows how to use a Java SE 7 feature called try-with-resources to handle Connection, Statement and ResultSet objects which are retrieved from a JBoss / WildFly Datasource.Prior to Java SE 7, developers needed a finally block to ensure that a resource is closed regardless of whether the try statement successfully completed or not. … Read more

JBoss AS 7 deployable datasources

  JBoss AS 7.1.1 has been released and one of its appealing news is the “resurrection” of the earlier -ds.xml datasources which can now be deployed as a standalone resource or even as part of an application. We have to admit, we were missing it. Although configuring a datasource with AS7 just requires a few … Read more

How to configure a Datasource with JBoss / WildFly

A Datasource is the component used by Enterprise applications to connect to the database. The datasource, in turn, uses a Driver to communicate with the underlying database. For this reason, for WildFly to provide database integration, it needs a Driver and a Datasource. Out of the box, WildFly ships with a default configuration, which includes … Read more