Programming & Development / April 11, 2025

How to Represent Central African Republic’s Prefectures in Java and SQL Using ISO 3166-2 Codes

Central African Republic prefectures Java enum CAR ISO 3166-2 CF SQL CAR divisions Central African Republic administrative divisions Spring Boot enum CAR prefectures list CF region codes prefectures of Central African Republic

🇨🇫 Java Enum: Central African Republic’s Prefectures

The Central African Republic is divided into 16 prefectures, 1 commune (Bangui), and 2 economic prefectures, making a total of 19 subdivisions. Below is the Java enum using the official ISO 3166-2:CF codes:

java

public enum CentralAfricanRepublicPrefecture {
    BANGUI("CF-BGF"),
    BAS_MBOMOU("CF-BB"),
    BASSE_KOTTO("CF-BK"),
    HAUTE_KOTTO("CF-HK"),
    HAUTE_MBOMOU("CF-HM"),
    KEMO("CF-KG"),
    LOBAYE("CF-LB"),
    MAMBERE_KADEI("CF-MK"),
    MAMBERE("CF-MB"),
    MBOMOU("CF-MP"),
    NANA_GREBIZI("CF-NG"),
    NANA_MAMBERE("CF-NM"),
    OMBELLA_MPoko("CF-OP"),
    OUAKA("CF-UK"),
    OUHAM("CF-AC"),
    OUHAM_PENDE("CF-OP"),
    SANGHA_MBAMBE("CF-SB"),
    VAKAGA("CF-VK"),
    BANGUI_COMMUNE("CF-BGF");

    private final String code;

    CentralAfricanRepublicPrefecture(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

CREATE TABLE car_prefectures (
    id SERIAL PRIMARY KEY,
    name VARCHAR(64) NOT NULL,
    code VARCHAR(10) NOT NULL UNIQUE
);

INSERT INTO car_prefectures (name, code) VALUES
('Bangui', 'CF-BGF'),
('Bamingui-Bangoran', 'CF-BB'),
('Basse-Kotto', 'CF-BK'),
('Haute-Kotto', 'CF-HK'),
('Haut-Mbomou', 'CF-HM'),
('Kémo', 'CF-KG'),
('Lobaye', 'CF-LB'),
('Mambéré-Kadéï', 'CF-MK'),
('Mbomou', 'CF-MP'),
('Nana-Grébizi', 'CF-NG'),
('Nana-Mambéré', 'CF-NM'),
('Ombella-Mpoko', 'CF-OP'),
('Ouaka', 'CF-UK'),
('Ouham', 'CF-AC'),
('Ouham-Pendé', 'CF-OP'),
('Sangha-Mbaéré', 'CF-SB'),
('Vakaga', 'CF-VK');

✅ Summary

This setup represents the 16 prefectures, 2 economic prefectures, and the Bangui commune of the Central African Republic using ISO 3166-2:CF codes. Ideal for geographic data handling in software systems.


Comments

No comments yet

Add a new Comment

NUHMAN.COM

Information Technology website for Programming & Development, Web Design & UX/UI, Startups & Innovation, Gadgets & Consumer Tech, Cloud Computing & Enterprise Tech, Cybersecurity, Artificial Intelligence (AI) & Machine Learning (ML), Gaming Technology, Mobile Development, Tech News & Trends, Open Source & Linux, Data Science & Analytics

Categories

Tags

©{" "} Nuhmans.com . All Rights Reserved. Designed by{" "} HTML Codex