Closing. StandardDialectResolver already has:
if ( databaseName.startsWith( "DB2/" ) ) { return new DB2Dialect(); }