con = dataSource.getConnection();
DatabaseMetaData metaData = con.getMetaData();
databaseProduct = metaData.getDatabaseProductName();
con.close();
} catch (SQLException sqle) {
throw new JDBCRepositoryException(EXCEPTION_LOCALIZER.format(
"sql-exception"), sqle);
}
if (PRODUCT_ORACLE.equalsIgnoreCase(databaseProduct)) {
vendor = JDBCDriverVendor.ORACLE8;
} else if (databaseProduct != null && databaseProduct.regionMatches(
true, 0, PRODUCT_DB2, 0, PRODUCT_DB2.length())) {
vendor = JDBCDriverVendor.DB2;
} else if (PRODUCT_MSSQL.equalsIgnoreCase(databaseProduct)) {
vendor = JDBCDriverVendor.MSSQL_JSQL;
} else if (PRODUCT_SYBASE.equalsIgnoreCase(databaseProduct)) {
vendor = JDBCDriverVendor.SYBASE;
} else if (PRODUCT_POSTGRES.equalsIgnoreCase(databaseProduct)) {
vendor = JDBCDriverVendor.POSTGRESQL;
} else if (PRODUCT_HYPERSONIC.equalsIgnoreCase(databaseProduct)) {
vendor = JDBCDriverVendor.HYPERSONIC;
} else if (PRODUCT_MYSQL.equalsIgnoreCase(databaseProduct)) {
vendor = JDBCDriverVendor.MYSQL;
} else if (PRODUCT_DERBY.equalsIgnoreCase(databaseProduct)) {
vendor = JDBCDriverVendor.DERBY_SERVER;
} else {
throw new JDBCRepositoryException(EXCEPTION_LOCALIZER.format(
"jdbc-unknown-vendor",
databaseProduct));
}
}
return vendor;