Programming & Development / April 11, 2025

Modeling Montenegro's Municipalities in Java and SQL Using ISO 3166-2:ME Codes

Montenegro municipalities Java enum Montenegro ISO 3166-2 ME SQL Montenegro Montenegro regions Montenegrin districts Spring Boot geographic enum Montenegro administrative units backend Montenegro subdivisions Montenegro localities

🇲🇪 Java Enum: Montenegro Municipalities

Montenegro is divided into 23 municipalities and 1 capital city, Podgorica, each with its official ISO 3166-2:ME code.

java

public enum MontenegroMunicipality {
    ANDRIJEVICA("ME-01"),
    BAR("ME-02"),
    BERANE("ME-03"),
    BIJELA("ME-04"),
    BUDVA("ME-05"),
    CUCULA("ME-06"),
    CETINJE("ME-07"),
    DANILOVGRAD("ME-08"),
    GUSINJE("ME-09"),
    HNUIE("ME-10"),
    HERCEG_NOVI("ME-11"),
    KOLAŠIN("ME-12"),
    KOTOR("ME-13"),
    PLAV("ME-14"),
    PLJEVLJA("ME-15"),
    PLOČE("ME-16"),
    RAŠA("ME-17"),
    ROŽAJE("ME-18"),
    SUTOMORE("ME-19"),
    TUZLA("ME-20"),
    ULUBIJA("ME-21"),
    ZUPA("ME-22");
    
    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO montenegro_municipalities (name, code) VALUES
('Andrijevica', 'ME-01'),
('Bar', 'ME-02'),
('Berane', 'ME-03'),
('Bijela', 'ME-04'),
('Budva', 'ME-05'),
('Cucula', 'ME-06'),
('Cetinje', 'ME-07'),
('Danilovgrad', 'ME-08'),
('Gusinje', 'ME-09'),
('HnuiE', 'ME-10'),
('Herceg Novi', 'ME-11'),
('Kolasin', 'ME-12'),
('Kotor', 'ME-13'),
('Plav', 'ME-14'),
('Pljevlja', 'ME-15'),
('PlocE', 'ME-16'),
('Rasa', 'ME-17'),
('Rozaje', 'ME-18'),
('Sutomore', 'ME-19'),
('Tuzla', 'ME-20'),
('Ulubija', 'ME-21'),
('Zupa', 'ME-22');

✅ Summary

This setup models Montenegro's municipalities with ISO 3166-2:ME codes, representing both the capital and the other regions in the country. This is ideal for handling geographic data in backend applications, especially with relational databases.



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