A database connection can be obtained in different ways. One should
hide this design decision in a utility class, such that changes to this
decision will have minimal ripple effects. Another important benefit is
elimination of code repetition.

Example

This is taken from the WEB4J example application.
Here, a Connection is
obtained from a JNDI DataSource configured on the server. An alternate
implementation might obtain a Connection directly from the JDBC
driver. (Some modern drivers include a built-in connection pool.)

This implementation is slightly unusual in that it can return a Connection
for more than one database.