Hola gente, les hago una consulta, estoy creando un vector de string con unos codigos de una tabla, pero el me sale un mensaje de error diciendo "EL CONJUNTO DE RESULTADOS ESTA CERRADO" que podra ser???
public String[] cargarProveedores(Connection con)
{
String aux[]=null;
int i=0;
try
{
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select cod_proveedor from proveedores");
ResultSet cant=st.executeQuery("select count(*) from proveedores");
cant.next();
int cantidad_filas=cant.getInt(1);
aux=new String[cantidad_filas];
while(rs.next()) //EN ESTA LINEA DA EL ERRROR
{
aux[i]=rs.getString(1); //OH EN ESTA LINEA
i++;
}
st.close();
}
catch(SQLException e)
{
JOptionPane.showMessageDialog(null,e.getMessage());
System.out.println("ERORR CON CARGA DE PROVEEDORES!!!!");
}
return aux;
}
Muchas Gracias
Saludos!