In some circumstances, the userName and password for
the JDBC connection are not known to the application
(e.g. a J2EE app using JBoss' connection pools). The
userName and password are never specified.
Some implementations of DataSource (noteably the one in
JBoss 2.4.3) do not treat
DataSource.getConnection(null, null) the same as
DataSource.getConnection(), which should use the
credentials specified in the pool configuration. The
end result is that the database refuses the logon
unless the userName and password are explicitly
supplied by the application to
This patch tests for a null userName and explicitly
calls the appropriate DataSource.getConnection method.