Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Java Architecture help !!

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Java Architecture help !!

    Hi,
    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 !!....


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default 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.
    Last edited by copeg; September 20th, 2010 at 01:14 PM.

Similar Threads

  1. a new pattern with a new architecture
    By mcgrow in forum Web Frameworks
    Replies: 0
    Last Post: August 4th, 2010, 02:28 PM
  2. Confusion about DAO in Three-Tier Architecture!
    By maven in forum Object Oriented Programming
    Replies: 1
    Last Post: July 24th, 2010, 08:09 AM
  3. cross platform architecture in Java/J2ee
    By softwarebuzz in forum Web Frameworks
    Replies: 1
    Last Post: January 9th, 2010, 02:43 PM

Tags for this Thread