private static IDataTypeFactory getDataTypeFactoryForConnection(Connection connection) throws SQLException {
        DatabaseMetaData metaData = connection.getMetaData();
        String databaseProductName = metaData.getDatabaseProductName().toLowerCase();

        IDataTypeFactory dataTypeFactory = null;

        if ("oracle".toLowerCase().equals(databaseProductName)) {
            dataTypeFactory = new OracleDataTypeFactory();
        } else if ("PostgreSQL".toLowerCase().equals(databaseProductName)) {
            dataTypeFactory = new PostgresqlDataTypeFactory();
        } else if ("mysql".toLowerCase().equals(databaseProductName)) {
            dataTypeFactory = new MySqlDataTypeFactory();
        } else if ("mssql".toLowerCase().equals(databaseProductName)
                || "Microsoft SQL Server".toLowerCase().equals(databaseProductName)) {
            dataTypeFactory = new MsSqlDataTypeFactory();
        } else if ("Mckoi".toLowerCase().equals(databaseProductName)) {
            dataTypeFactory = new MckoiDataTypeFactory();
        } else if ("hsql".toLowerCase().equals(databaseProductName)) {
            dataTypeFactory = new HsqldbDataTypeFactory();
        } else if ("h2".toLowerCase().equals(databaseProductName)) {
            dataTypeFactory = new H2DataTypeFactory();
        } else if ("db2".toLowerCase().equals(databaseProductName)) {
            dataTypeFactory = new Db2DataTypeFactory();
        } else {
            log.warn("getDataTypeFactoryForConnection: Unrecognized database vendor");
        }

        return dataTypeFactory;
    }