Collection List object performance
I have a situation in Java Collection and i am not able to figure a good solution. I am scared about the performance and memory that wil be used
I have 5 List objects with thousands and thousands of records in it. The List is populated by a database query using jdbcTemplate which return like 200,000 records
Each record is identified by POLICY_ID. They may be List with multiple records for a POLICY_ID
I want to extract each POLICY_ID from all the 5 List and make a single List object for each POLICY_ID and for each List and pass it to a print job which will print the data for a POLICY_ID
Let say we have POLICY_ID = 15432
List1 has one record for 15432
List2 has one record for 15432
List3 has one record for 15432
List4 has three record for 15432
List5 has three record for 15432
From the 200,000 records in List1 i want to generate a seperate list with 1 record for policy id 15432 and let name is Listperpolicy
after this logic we have
Can you please guide me on the approach i should take to write a better code
call print job ( Listperpolicy1, Listperpolicy2, Listperpolicy3, Listperpolicy4, Listperpolicy5)
Please let me know
Thanks a Lottttttttt
Maybe you are taking the wrong approach at the beginning. A good design would eliminate the need to fetch all those records.
Originally Posted by piusfernandez
Happiness is good health and a bad memory.
Why do you need to create a series of lists if you are getting these records from a database? Shouldn't you have your query populate a Table?
As aniseed suggested, perhaps you should be looking at your problem from another angle. How about creating a class of PolicyHolder, identified with a PolicyHolder_ID of some sort, holding an array or vector of [Policy_ID records]. Search for policy holder, extract the policy/policies. of course, this is dependent upon your needs and your skill at generating queries from your database ...
By JFeng in forum ASP.NET
Last Post: 07-21-2006, 02:23 PM
By Ramses@devx in forum .NET
Last Post: 10-28-2002, 09:32 AM
By Larry Rebich in forum .NET
Last Post: 05-28-2002, 12:15 AM
By Jaco de Villiers in forum XML
Last Post: 06-01-2001, 06:50 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL