final int databaseMinorVersion = metaData.getDatabaseMinorVersion();
if ( databaseMajorVersion > 10 || ( databaseMajorVersion == 10 && databaseMinorVersion >= 6 ) ) {
return new DerbyTenSixDialect();
}
else if ( databaseMajorVersion == 10 && databaseMinorVersion == 5 ) {
return new DerbyTenFiveDialect();
}
else {
return new DerbyDialect();
}
}