Java Architecture help !!
I have around 4 tables in jsp. And i fill these tables based on the data fetched by the database using .java class.
Here, i have to create 4 different connections to fetch the data, for each table :(
Is there any way, by which i can fetch the data for all the 4 tables at a single go !!
waiting for some smart answers !!....
Re: Java Architecture help !!
The answer to this is the basis behind a few J2EE design patterns. One suggestion: create a SessionFacade where the client makes a single call, and the 'facade' does all the dirty work to retrieve the data and sends it back to the client (google this term and you'll pull up some examples). Depending upon how complex the data is, you could a) do this in a Stateful Session Bean or b) return some kind of data transfer object which contains all the data you requested. How you retrieve the data either way is up to you (custom class, CachedRowSets, Entity Beans, TableModel, etc...). If you have other clients/pages which also request similar data but in different combinations, you could create a single function that accepts a bitmasked flag telling the function which data combinations to retrieve.