I've been working on a project that uses Servlets on the server-side and an Applet on the client-side. The applet contains a JList. When loading, the applet sends a request to a servlet for data from a database. The servlet obtains the necessary records and loads a 2D array. I made a serialized class named TableData which wraps the 2D array. The servlet then sends the TableData object out the wire using the writeObject() method. The applet then receives the TableData object with the readObject() method and extracts the 2D array in order to load the JList.
I rudely discovered that this approach only works if the data being sent consists of only 15 - 20 records from the database. Otherwise, anything greater than 20 records, I wind up with this OutOfMemory Error message. This is not good! I hate these kind of gotchas!
I'm sure there must be many out there who have loaded JLists or JTables with data in applets before. Is there a better approach to this problem than the one I just described that avoids this OutOfMemory error?
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