pmd/pmd-mysql/etc/ant_task_code.txt

18 lines
575 B
Plaintext
Raw Normal View History

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 );
}
}