.getValue());
}
}
} catch (Exception ex)
{
throw new DatabaseOperationException(ex);
}
String databaseName = null;
_databaseName = null;
try
{
databaseName = (String) parameters.get(DATASOURCE_DATABASENAME);
if (databaseName != null)
{
platform = PlatformFactory.createNewPlatformInstance(databaseName);
if (platform != null)
_databaseName = databaseName;
}
} catch (Exception ex)
{
log.warn("Exception in trying to establish connection to " + databaseName + " : " + ex.getLocalizedMessage(), ex);
}
if (_databaseName == null)
{
_databaseName = new PlatformUtils().determineDatabaseType(dataSource);
if (_databaseName == null)
{
throw new DatabaseOperationException(
"Could not determine platform from datasource, please specify it in the jdbc.properties via the ddlutils.platform property");
}
else
{
try
{
platform = PlatformFactory.createNewPlatformInstance(_databaseName);
} catch (Exception ex)
{
throw new DatabaseOperationException(
"Could not establish connection to " + _databaseName + " : " + ex.getLocalizedMessage(),ex);
}
}
}
// com.mysql.jdbc.Driver