Hi I am trying to fetch data from 2 place. One from Database and second from class file. After getting data I want to return those both ResultSet object to other file using return keyword but how to return 2 resultsets I don't know.
My code :
public ResultSet getdata(String query, boolean test, List<CartEntry> items)
{
int k;
try
{
Connection conn;
Statement st;
public ResultSet rs,result;
List<Product> prodList = new ArrayList<Product>();
for(CartEntry ce : items)
{
prodList.add(new Product("p" + ce.getpId(), "test", "prod" + ce.getpId(), (int)ce.getpId(), ce.getpId() + 0.12f, ce.getQuantity()));
result = new DummyResultSet(prodList);
k = ce.getQuantity();
System.out.println(k);
}
st=conn.createStatement();
rs=st.executeQuery(query);
querystatus=true;
return rs;
}
catch(Exception e)
{
querystatus=false;
}
}
the last line in try block i.e. return rs;
I want something like return rs,result;
but how to implement it I don't know. I have tried it simply like that but it doesn't work, it gives me an error.
Anyone have Idea that how to return data to other file and how to retrieve it ??