Füllen JSP dropdown mit Datenbank-Infos

Ich versuche, füllen Sie eine JSP-dropdown aus einer Datenbank-Tabelle.

Hier ist der code, der das array erstellen und füllen es mit den Datenbank-Infos:

//this will create my array 
public static ArrayList<DropDownBrands> getBrandsMakes() {
    ArrayList<DropDownBrands> arrayBrandsMake = new ArrayList<DropDownBrands>();
    while (rs.next()) {     
        arrayBrandsMake.add(loadOB(rs));
    }
    return arrayBrandsMake;
}

//this will load my array object
private static DropDownBrands loadOB(ResultSet rs) throws SQLException {
    DropDownBrands  OB = new DropDownBrands();
    OB.setBrands("BRAN");
    return OB;
}

Wie rufe ich diese Klasse aus meiner JSP und füllen Sie die dropdown?

InformationsquelleAutor Cano63 | 2010-05-25
Schreibe einen Kommentar