Hi,
I am looking for best approach to query db table and get corresponding values on the basis of Ids passed.
I have ids in String array, please provide best approach for point (a) and (b), what to use ArrayList, HashMap, etc... so that there are minimum loops...
Sample code:
-------
String[] idsToDelete = request.getParameterValues("idValue");
System.out.println("idsToDelete.length is :"+idsToDelete.length);
for (int i = 0; i < idsToDelete.length; i++) {
System.out.println("Id to pass to query to get corresponsing items : "+idsToDelete[i]);
}
Output:
-------
[STDOUT] idsToDelete.length is :2
[STDOUT] Id to pass to query to get corresponsing items : 25
[STDOUT] Id to pass to query to get corresponsing items : 24
a) Get itemName, itemLocation, status from single table on the basis of this id in some method.
//Some method where I can pass above "idsToDelete" (25, 24...) and store corresponding values (itemName, itemLocation, status)
b) Then pass these itemName, itemLocation, status to a proceduer in java method which will call proceduer for each set of itemName, itemLocation, status.
//Some method using the stored corresponding values (itemName, itemLocation, status) and pass to proceduer for each set of itemName, itemLocation, status