
25/10/2010, 23:42
|
 | | | Fecha de Ingreso: enero-2009 Ubicación: BOGOTA
Mensajes: 312
Antigüedad: 16 años, 1 mes Puntos: 5 | |
Respuesta: DEVOLVER UN HashMap YA ME LA PILLE
public HashMap[] getUsers() throws SQLException
{
HashMap hm[] = new HashMap[100];
int i = 0;
String strSQL = "SELECT * FROM users ORDER BY pk_user DESC";
this.st = this.co.createStatement();
this.rs = this.st.executeQuery(strSQL);
while(this.rs.next())
{ hm[i] = new HashMap();
hm[i].put("login", this.rs.getString("login"));
hm[i].put("password", this.rs.getString("password"));
i++;
}
return hm;
} |