, JDBCConfiguration conf) {
if (StringUtils.isEmpty(prod))
return null;
prod = prod.toLowerCase();
PluginValue dbdictionaryPlugin = ((JDBCConfigurationImpl) conf)
.dbdictionaryPlugin;
if (prod.indexOf("oracle") != -1)
return dbdictionaryPlugin.unalias("oracle");
if (prod.indexOf("sqlserver") != -1)
return dbdictionaryPlugin.unalias("sqlserver");
if (prod.indexOf("jsqlconnect") != -1)
return dbdictionaryPlugin.unalias("sqlserver");
if (prod.indexOf("mysql") != -1)
return dbdictionaryPlugin.unalias("mysql");
if (prod.indexOf("postgres") != -1)
return dbdictionaryPlugin.unalias("postgres");
if (prod.indexOf("sybase") != -1)
return dbdictionaryPlugin.unalias("sybase");
if (prod.indexOf("adaptive server") != -1)
return dbdictionaryPlugin.unalias("sybase");
if (prod.indexOf("informix") != -1 || prod.indexOf("ids") != -1)
return dbdictionaryPlugin.unalias("informix");
if (prod.indexOf("ingres") != -1)
return dbdictionaryPlugin.unalias("ingres");
if (prod.indexOf("hsql") != -1)
return dbdictionaryPlugin.unalias("hsql");
if (prod.indexOf("foxpro") != -1)
return dbdictionaryPlugin.unalias("foxpro");
if (prod.indexOf("interbase") != -1)
return InterbaseDictionary.class.getName();
if (prod.indexOf("jdatastore") != -1)
return JDataStoreDictionary.class.getName();
if (prod.indexOf("borland") != -1)
return JDataStoreDictionary.class.getName();
if (prod.indexOf("access") != -1)
return dbdictionaryPlugin.unalias("access");
if (prod.indexOf("pointbase") != -1)
return dbdictionaryPlugin.unalias("pointbase");
if (prod.indexOf("empress") != -1)
return dbdictionaryPlugin.unalias("empress");
if (prod.indexOf("firebird") != -1)
return FirebirdDictionary.class.getName();
if (prod.indexOf("cache") != -1)
return CacheDictionary.class.getName();
if (prod.indexOf("derby") != -1)
return dbdictionaryPlugin.unalias("derby");
if (prod.indexOf("sapdb") != -1) {
return dbdictionaryPlugin.unalias("maxdb");
}
// test h2 in a special way, because there's a decent chance the string
// h2 could appear in the URL of another database
if (prod.indexOf("jdbc:h2:") != -1)
return dbdictionaryPlugin.unalias("h2");
if (prod.indexOf("h2 database") != -1)
return dbdictionaryPlugin.unalias("h2");
// test db2 last, because there's a decent chance this string could
// appear in the URL of another database (like if the db is named
// "testdb2" or something)
if (prod.indexOf("db2") != -1 || prod.indexOf("as400") != -1)
return dbdictionaryPlugin.unalias("db2");
if (prod.indexOf("soliddb") != -1)
return dbdictionaryPlugin.unalias("soliddb");
// known dbs that we don't support
if (prod.indexOf("cloudscape") != -1)
return DBDictionary.class.getName();
if (prod.indexOf("daffodil") != -1)
return DBDictionary.class.getName();
if (prod.indexOf("idb") != -1) // instantdb
return DBDictionary.class.getName();
String prodClassName = dbdictionaryPlugin.unalias(prod);
if (!StringUtils.equals(prod, prodClassName))
return prodClassName;
// give up
return null;