pmd/pmd-mysql/etc/ant_task_code.txt
Tom Copeland 923815c01e Initial revision
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1346 51baf565-9d33-0410-a72c-fc3788e3496d
2003-01-16 19:40:33 +00:00

18 lines
575 B
Plaintext

for (Iterator i = databases.iterator(); i.hasNext();) {
try {
Database db = (Database) i.next();
if (!db.getDriver().equals("")) {
Class driverClass = Thread.currentThread().getContextClassLoader().
loadClass( db.getDriver() );
DriverManager.registerDriver( (Driver) driverClass.newInstance() );
}
JDBCReportListener listener =
new JDBCReportListener( db.getUrl(), db.getUser(),
db.getPassword(), db.getProjectId() );
report.addListener( listener );
} catch (Exception ex) {
throw new BuildException( ex );
}
}