Hi All!
Thanks a lot for all your
help through all this days.
I have a problem now:
I have a
servlet that calls a method from a class that access and retrieves data from a
table and sends back the resultset to the servlet, the first time I call the
servlet it works well, but the second time I call the servlet the resultSet has
no items. I show you my code for the class that access the DB:
public class ProductoDataAccessor {
private PreparedStatement
StatementMostrar;
..
StatementMostrar =
dbConnection.prepareStatement("select * from Productos order by descprod");
dbConnection.prepareStatement("select * from Productos order by descprod");
...
public Vector getProductList()
{
Vector VectorProductos = new Vector();
try
{
ResultSet dataResultSet = StatementMostrar.executeQuery();
{
Vector VectorProductos = new Vector();
try
{
ResultSet dataResultSet = StatementMostrar.executeQuery();
Producto Prod = null;
while
(dataResultSet.next())
{
Prod = new Producto(dataResultSet);
VectorProductos.addElement(Prod);
}
dataResultSet.close();
}
{
Prod = new Producto(dataResultSet);
VectorProductos.addElement(Prod);
}
dataResultSet.close();
}
catch (SQLException
e)
{
log(e);
}
finally
{
return VectorProductos;
}
}
{
log(e);
}
finally
{
return VectorProductos;
}
}
...
}
Cynthia Muñoz
