throws MappingException, SQLException
{
DatabaseRegistry dbs;
Properties props;
Enumeration params;
Param param;
String driverName = database.getDatabaseChoice().getDriver().getClassName();
if (driverName != null ) {
try {
Class.forName (database.getDatabaseChoice().getDriver().getClassName()).newInstance();
}
catch (InstantiationException e) {
_log.error (Messages.format ("jdo.engine.classNotInstantiable", driverName), e);
throw new MappingException(Messages.format ("jdo.engine.classNotInstantiable", driverName), e);
}
catch (IllegalAccessException e) {
_log.error (Messages.format ("jdo.engine.classNotAccessable", driverName, "constructor"), e);
throw new MappingException(Messages.format ("jdo.engine.classNotAccessable", driverName, "constructor"), e);
}
catch (ClassNotFoundException e) {
_log.error ("Can not load class " + driverName, e);
throw new MappingException("Can not load class " + driverName, e);
}
}
if (DriverManager.getDriver (database.getDatabaseChoice().getDriver().getUrl()) == null)
throw new MappingException( "jdo.missingDriver", database.getDatabaseChoice().getDriver().getUrl());
props = new Properties();
params = database.getDatabaseChoice().getDriver().enumerateParam();
while (params.hasMoreElements()) {
param = (Param) params.nextElement();
props.put (param.getName(), param.getValue());
}
dbs = new DatabaseRegistry (database.getName(),
mapping.getResolver(Mapping.JDO, factory),
factory,