List transactions)
{
url = StringUtils.replace(url, "@DB@", database);
System.out.println("Our new url -> " + url);
Driver driverInstance = null;
try
{
Class dc;
if (classpath != null)
{
log("Loading " + driver
+ " using AntClassLoader with classpath " + classpath,
Project.MSG_VERBOSE);
loader = new AntClassLoader(project, classpath);
dc = loader.loadClass(driver);
}
else
{
log("Loading " + driver + " using system loader.",
Project.MSG_VERBOSE);
dc = Class.forName(driver);
}
driverInstance = (Driver) dc.newInstance();
}
catch (ClassNotFoundException e)
{
throw new BuildException("Class Not Found: JDBC driver " + driver
+ " could not be loaded", location);
}
catch (IllegalAccessException e)
{
throw new BuildException("Illegal Access: JDBC driver " + driver
+ " could not be loaded", location);
}
catch (InstantiationException e)
{
throw new BuildException("Instantiation Exception: JDBC driver "
+ driver + " could not be loaded", location);
}
try
{
log("connecting to " + url, Project.MSG_VERBOSE);
Properties info = new Properties();
info.put("user", userId);
info.put("password", password);
conn = driverInstance.connect(url, info);
if (conn == null)
{
// Driver doesn't understand the URL
throw new SQLException("No suitable Driver for " + url);