I have 1 table in database

TableRoom
- NoRoom
- Status
and i have

room
101,
102,
103,
104,
105,
201,
202,
203,
204,
205

My problem is how to call a database and specify the colors for the buttons. if the status of the room was filled with the buttons should be colored red, and if the status of the room was empty, the button should be green

this my code:

private void setstatusroom(){
String status="";
String noRoom="";
String sql ="SELECT * from TableRoom where status = 'Full'";
//k101 = new JButton.

JButton [] arr = new JButton[10];
arr[0] = k101;
arr[1] = k102;
arr[2] = k104;
arr[3] = k103;
arr[4] = k105;
arr[5] = k201;
arr[6] = k202;
arr[7] = k203;
arr[8] = k204;
arr[9] = k205;


try{
koneksi db = new koneksi();
Connection c = db.OpenConnect();
Statement s = c.createStatement();
ResultSet r = s.executeQuery(sql);

if(r.next()){
status = r.getString("Status");
noRoom = r.getString("NoRoom");
for(int i=0; i<10; i++){
if (arr[i].getActionCommand().equals(nokam)){
r.beforeFirst();

while(r.next()){
arr[i].setBackground(Color.red);

}
s.close();
c.close();
} else {
arr[i].setBackground(Color.green);
}
}
}

}catch (SQLException d){
JOptionPane.showMessageDialog(null, "Error pada: " +d.getMessage());
}

}