Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
A DataSource is a
container-managed resource. The JBoss documentation recommends storing
the JAR outside of your EAR and in
$JBOSS_HOME/server/default/lib. (One big reason for
this is that JDBC drivers cannot be hot deployed.) For example, the
$JBOSS_HOME/server/default/lib directory is where
you’ll find hsqldb.jar—the JDBC driver for the
Hypersonic database. As an added benefit, if you store the drivers here,
you can share them across multiple EARs. With less duplication, there is
less of a chance for mismatched drivers and database versions.
Of course, if you are not going to be hot deploying your EARs you can include your JDBC drivers in your EAR. This gives you the added benefit of allowing each EAR to use potentially different or conflicting versions of the same JDBC driver.