How to populate Java Beans List from the DB ?

Hi,
I have three tables called State,District and College.
Assume, State table has fields statid,statename,statedescr
District table has fields districtId,districtname,districtdescr and stateid
College table has fields collegeid,collegename,collegedescr and districtid
and all ids for the respective tables are primary keys .. and District and College tables have foriegn keys as expected...
I want to send the whole information to the front end... I had designed three beans StateBean,DistrictBean and CollegeBean.. where all the three beans will have the related fiields and respective getter and setter methods like below
StateBean -- stateid,stateName,stateDesc and DistrictBeanList
DistrictBean -- districtid,districtName,districtDesc and CollegeBeanList
CollegeBean -- collegeid,collegeName,collegeDesc
I would like to have the JDBC code (any driver,any DB) so that I need to build one StateBeanList (collection of all the statebeans information) ... (like how to write the query to get the whole information from the DB and populate the same into one list..(Query or queries + resultset operation)
I hope you understand my problem ...
Please let me know if I have to be more clear...
Thanks in Advance,
Vidhya...

Thanks Sachin,
Atleast you understand something of my requirement..
But Actually I want the logic like
if the query is like
select * from State
while(rs.next) {
StateBean object = new StateBean(); // StateBean
object.yourcorrespondingsetter(rs.getString(1));
object.yourcorrespondingsetter(rs.getString(2));
object.yourcorrespondingsetter(rs.getString(3));
object.setDistrictBeanList(districtbeanlistalreadypopulated); // how to populate the list of districtBeans list before ....
listobject.add(object ); // object internally has to have districtBean list, so the district bean list has to be loaded with all the distrct Beans in which every DistrictBean will be loaded with list of CollegeBeans ... Which district belongs to which state and which college belongs which district is all there in the table information ...
Now I want the query or queries to do that .... Can someone help me ?
Please let me know if I have to be more clear...
}

Similar Messages

  • How can I create a list from the e-mail addresses "To:" field of an e-mail?

    Is there a way to automatically create a mailing list from a list of people who have received an e-mail? I know how to create a list manually, but there are a lot of e-mail addresses, so this would be an incredibly tedious process.
    Thanks!

    https://getsatisfaction.com/mozilla_messaging/topics/how_to_create_a_mailing_list_from_a_list_of_email_recipients
    Install the add-on and right-click any recipient in the To: field in the Header Pane.

  • How to remove a Sharepoint list from the Powerpoint app on iPads??

    Hello,
    I have added a Sharepoint "place" in Powerpoint app on an iPad and cannot find a way to remove it, the address of the SharePoint page/place/list has been changed so it is no longer relevant to me. Any tips?

    Hello Scott,
    I did post a question but for some reason it didn't post. What I typed was removed for some reason. So I'm trying again. I'll keep trying until it posts. I had installed a 3rd party sound editor program which added a sound device to the list with Mic and line in. It's also in the output list. All I need to do is remove the device and then AU will allow me to select line in as an input device. Right now AU is confused by the extra device and wont let me select an input device. AU is a developer app. But that's not the problem. The problem is removing the device from the list of sound devices.
    If someone knows where this device might be and how to remove it, please let me know.
    Thanks,
    Dave

  • HT4859 Last time I synced my IPad with my PC it migrated all my "Favorites" (about 100 folders) to the ICloud. I have searched and so far been unable to find out how to recover my "Favorites" list from the ICloud back to my PC. Any advice? Many thanks.

    Hi, Last time I synced my IPad with my PC, it (unknown to me) migrated all my PC "Favorites" (about 100 folders) to the ICloud.
    I have searched and so far been unable to find out how to recover my "Favorites" from the ICloud back to my PC. Any advice would
    be appreciated. Thank you.

    What did you do to get them synced to the Cloud.  Would that procedure help me get my favorites synced to my iPad2?

  • How to populate data in fields from the same cube

    HI Gurs,
    Need some help. I have a cube it has 11 key figures . Data for 7 of those is coming from another cube for rest of the 4 we need to calculate from two of those 7 fields. e.g.
    Field 1= Field2(First Cube) - Field3(FirstCube)
    Field4= Field5(FirstCube)/1.5
    Field 6 = Field1 / Field4
    I need to pupulate field 4 in the final cube.
    How can I achieve this?
    Can anyone please suggest anything?

    Hi Ray,
    One is as suggested by surendra i.e to populate thru End routine,take help of an ABAPer and do it.
    Else just add the new 4 KF  in the New Cube i.e Cube 2 and in the Individual Routine /Field Routine you can write the same Formula in the  Result of it.Say,For Fields 1 you have to have Field 2,Field 3 and Field 5 as input ,which you hvae include manually in the Individual/Field Routine.
    In Result for Field 1= Field2(First Cube) - Field3(FirstCube)
    In Result for Field4= Field5(FirstCube)/1.5
    In Result for Field 6 = (Field2(First Cube) - Field3(FirstCube) / Field5(FirstCube)/1.5)
    Hope you got it ....
    Rgds
    SVU123

  • How to populate a Dropdown List from a Value Node

    Hi
    I have a WD application Java with an Interactive Form. In the WD context I have a value node of cardinality 0..n. In the Interactive Form I need to have the values of this node within a dropdown list. Which type of DDL is best choice and how do I manage to get the node values into the list.
    We are working on NW2004 with Designer 7.08.
    Thank you for any suggestions.
    René Morel

    hi,
    With respect to your problem please refer to this guide/tutorial.
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/98af7acd-0401-0010-f697-bfa06971b65e
    Hope this helps you.
    Thanks,
    kris

  • How to migrate Java Dictionary content from the one to the other server?

    Good day!
    We have a few developments which uses java dictionary DC and JPA. It's on NW CE7.2. Now we need to migrate all developments to NW 7.4. The question is how to migrate all java dictionary content for these developments? The main purpose not to develop any more:).
    Thanks in advance!

    I think the problem is solved.
    Through the SQL Developer (Oracle) we can export the needed data and import it again where we need it.

  • How to delete an xml list from the data grid using the check box and button

    i am using an XMLList as the dataprovider for the dataGrid,
    there i have a checkbox for each row, i need to delete the row for
    which the checkbox is selected with the help of a delete
    button.

    Your checkbox must update a property of the dataProvider when
    checked. You can then loop through the XMLList, checking that
    property. when you find it use the "delete" operator on the found
    node.
    Tracy

  • How to populate a sharepoint 2010 list from the active directory. How to populate a sharepoint 2010 list with all sharepoint user profiles

    How to populate a sharepoint 2010 from the active directory.
    I want a list of all the computers in the active directory,
    another one with all users.
    I want also to populate a sharepoint 2010 list from the sharepoint user profiles.
    Thanks
    sz

    While
    the contacts list is usually filled out for contacts that are outside the company, there are times when you would use a contacts list to store internal and external resources.  Wouldn’t it be nice if you didn’t have to re-type your internal contacts’
    information that are already in the system?  Now you can with a little InfoPath customization on the contacts list. 
    Here’s our plan:
    Create the contacts list, and open in InfoPath
    Create a data connection to the User Profile web service
    Customize the form adding some text, a people picker and a button
    Create InfoPath rules that will populate the contact fields from the user fields in the User Profile store
    Let’s get going!  Before we begin, make sure you have InfoPath 2010 installed locally on your computer.  I also want to give credit Laura
    Rogers and Darvish Shadravan’s book Using
    Microsoft InfoPath 2010 with Microsoft SharePoint 2010 Step by Step.  I know it looks like a lot of steps, but it’s easy once you get the hang of it.
    So obviously we need a contacts list.  If you don’t already have one, go to the SharePoint site where it will live, and create a contacts list.
    From the list, click the List tab on the ribbon, then click Customize form:
    So now we have our form open in InfoPath 2010.  Let’s add our elements to the form. 
    Above all the fields, let’s add some text instructing users what to do with the the field we’re about to add (.e.g To enter an existing user’s information, choose the user below).
    Insert a people picker control by clicking the Person/Group Picker control in the Controls section of the ribbon.  This will add a column to the contacts list called group.
    Below the people picker, insert a button control from the same section of the ribbon as above.  With the button still highlighted, click the Control Tools|Properties tab on the ribbon. 
    Then in the Label box, change the text to something more appropriate to our task (e.g. Click here to load user data!).
    You can drag the button control a little larger to account for the text.
    We should end up with something like this:
    Before we can populate the fields with user data, we need to create a connection to the User Profile Service.
    Add a data connection to the User Profile Service
    Click the Data tab on the ribbon, and click the option From Web Service, and From SOAP Web Service.
    For the location, enter the URL of your SharePoint site in the following format – http://<site url>/_vti_bin/UserProfileService.asmx?WSDL.  Click Next.
    Note - for the URL, it can be any SharePoint site URL, not just to the site where your list is.
    For the operation, choose GetUserProfileByName.  Click Next.
    Click Next on the next two screens.
    On the final screen, uncheck the box for “Automatically retrieve data when form is opened”. This is because we are going to retrieve the data when the button is clicked, also for performance reasons.
    Now we need to wire up the actions on our button to populate the fields with the information for the user in the people picker control.
    Tell the form to read the user from the people picker control
    Click the Home tab on the ribbon.
    Click the button control we created, and under the Rules section of the ribbon, click Manage Rules. Notice the pane appear on the far right.
    In the Rules pane, click New –> Action. Change the name to something like “Query and load user data”.
    Leave the condition to default (none – rule runs when button is clicked).
    Click the Add button next to “Run these actions:”, and choose “Set a field’s value”.
    For Field, click the button on the right to load the select a field dialog.  Click the Show advanced view on the bottom.  At the top, click the drop down and choose the GetUserProfileByName
    (Secondary) option.  Expand myFields and queryFields to the last option and highlightAccountName.  Click ok. 
    For Value, click the formula icon. On the formula screen, click the Insert Field or Group button. Again click the show advanced view link, but this time leave the data
    connection as Main. Expand dataFields, then mySharePointListItem_RW.  At the bottom you should see a folder called group (the people picker control we just added to the form).  Expand this, then pc:Person,
    and highlightAccountId.  Click Ok twice to get back to the Rules pane.
    If we didn’t do this and just queried the user profile service, it would load the data of the currently logged in user.  So we need to tell the form what user to load the data for.  We take the AccountID field from the people
    picker control and inject into the AccountName query field of the User Profile Service data connection. 
    Load the user profile service information for the chosen user
    Click the Add button next to “Run these actions:”, and choose Query for data.
    In the popup, for Data connection, click the one we created earlier – GetUserProfileByName and clickOk.
    We’re closing in on our goal.  Let’s see our progress.  We should see something like this:
    Now that we have the user’s data read into the form, we can populate the fields in the contact form.  The number of steps to complete will depend on how many fields you want to populate.  We need to add an action step for
    each field.  I’ll show you one example and then you will just repeat the steps for the other fields.  Let’s update the Job Title field.
    Populate the contact form fields with existing user’s data
    Click the Add button next to “Run these actions:”, and choose “Set a field’s value”.
    For Field, click the button on the right to load the select a field dialog.  Highlight the field Job Title.
    For Value, click the formula icon. On the formula screen, click the Insert Field or Group button.  Click the Show advanced view on the bottom. At the top, click the
    drop down and choose theGetUserProfileByName (Secondary) option.  Expand the fields all the way down until you see the Value field.  Highlight it but don’t click ok, but click the Filter
    Data button, then Add. 
    For the first dropdown that says Value, choose Select a field or group.   The value field will be highlighted, but click the field Name field
    under PropertyData.  Click Ok. 
    In the blank field after “is equal to”, click in the box and choose Type text.  Then type the text Title. 
    Click ok until you get back to the Manage Rules pane.  The last previous screen will look like this.
    We’re going to update common fields that are in the user’s profile, and likely from Active Directory.  You can update fields like first and last name, company, mobile and work phone number, etc.  For the other fields, the
    steps are the same except the Field you choose to update from the form, and the very last step where you enter the text will change.  Here’s what the rules look like when we’re done:
    We’re all done, good work!  You can preview the form and try it now.  Click Ctrl+Shift+B to preview the form.  Once you’re satisfied, you can publish the form back to the library.  Click File –> Quick
    Publish.  Once it’s done, you will get confirmation:
    Now open your form in SharePoint.  From the contact list, click Add new item.  Type in a name, and click the button and watch the magic happen!

  • How to call backing bean method from java script

    Hi,
    I would like to know how to call backing bean method from java script.
    I am aware of serverListener and [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    but i am running in to some issues with [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    regarding which i asked for help in other thread with subject ....Question on AjaxAutoSuggest article (Ajax Transactions Using ADF and J...)
    The reason why i posted is ( though i realise both are duplicates) .. that threads looks as a specific question to that article hence i would like to ask the quantified problem is asked in this thread.
    So could any please letme know how to call backing bean method from java script
    Thanks
    Murali
    Edited by: mchepuri on Oct 24, 2009 6:17 PM
    Edited by: mchepuri on Oct 24, 2009 6:20 PM

    Hello,
    May know how to submit a button autoamtically on onload of page with clicking a welcome alert box. the submit button has managed button too to show a message on console using SOP.
    the problem is.
    1. before loading the page a javascript comes on which i clicked ok
    2. the page gets loaded and the button is there which gets automatically clicked and the managed bean associated with prints a message on console using SOP.
    I m trying to do this through server listener and click listener. the code is(adf jspx page)
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.backing_check4.d1}">
    <af:form id="f1" binding="#{backingBeanScope.backing_check4.f1}">
    <af:commandButton text="commandButton 1"
    binding="#{backingBeanScope.backing_check4.cb1}"
    id="cb1" action="#{beanCheck4.submit1}"/>
    <af:clientListener type="click" method="delRow"/>
    <af:serverListener type= "jsServerListener"
    method="#{backingBeanScope.backing_check4.submit1}"/>
    <f:facet name="metaContainer">
    <af:resource type ="javascript">
    x=confirm("hi");
    // if(x){
    delRow = function(event){
    AdfCustomEvent.queue(event.getSource(), "jsServerListener", {}, false);
    return true;
    </af:resource>
    </f:facet>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_check4-->
    </jsp:root>
    the backing bean code is -----
    public class classCheck4 {
    public classCheck4() {
    public String submit1() {
    System.out.println("hello");
    return null;
    }

  • I've a new account on iMac.  When composing an email the contact list does not show up on the bar.  WWhen I start keying in a name, it comes up with the address.  How do I engage the  contact list from the email?

    I've a new account on iMac.  When composing an email the contact list does not show up on the bar, which would allow me to select the persons I want to include on the distribution of the email.  When I start keying in a name in the email, it comes up with the person's address, which shows it is synced.  How do I engage the contact list from the email like I do on my old account (where a contact list icon shows up, along with the "attach" and other icons) ?

    With the New Message window open, go to the View menu and select "Customize Toolbar...".
    In the screen that opens, drag the item labelled "Address" into the Toolbar area of the New Message window, then click the "Done" button.
    That item should be then added to the Toolbar for the New Message window.
    Note that the main Mail window and the New Message window (as well as the separate message window if you open a message that way) use different toolbars - the settings/inclusions for one do not carry over to another.

  • How do I remove an app from the update list that is under someone else's apple id?

    How do I remove an app from the update list that is under someone else's apple id? So this way the update always fails because it asks for someone else's password. I don't have the app on my mac, it only appears in the update list. It's just annoying, because the update keeps appearing, and the reminder keeps reminding me that I should install a new update.

    You installed a hacked app, originally from the Mac App Store. It contains the receipt for a different app, downloaded using an account that you don't control. You need to identify and remove the hacked app.
    Important: The app you need to remove is not necessarily the one named in the App Store alert. For example, the App Store may prompt you to update "Angry Birds" or "Twitter," but the hacked app may be something else entirely. Don't make any assumptions about which app you're looking for. To find it, you must carry out a systematic search with Spotlight.
    1. Triple-click anywhere in the line of text below on this page to select it:
    kMDItemAppStoreHasReceipt=1
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    2. In the Finder, press command-F to open a search window, or select
    File ▹ Find
    from the menu bar. In the search window, select
    Search: This Mac
    from the row of tokens below the toolbar. Below that is a popup menu of search criteria, initially showing Kind. From that menu, select
    Other...
    A sheet will drop down. In that sheet, select
    Raw Query
    as the criterion, then click OK or press return.
    Now there will be a text box to the right of the menu of search criteria. That's where you enter the raw search query. Click in that box and paste the text you copied earlier by pressing command-V.
    4. The search window will now show all the App Store products that are installed. Compare those search results with the list of your purchases from the App Store. To see the complete list, you may need to unhide hidden purchases. If any apps were download from the App Store using other Apple ID accounts that you control, sign in to the store under each of those ID's and check the purchases.
    At least one of the apps in the Spotlight search results is not among your purchases in the App Store. Move each such item to the Trash, after quitting it if it's running. You may be prompted for your administrator password. Empty the Trash.
    Quit and relaunch the App Store. Test.
    If you find these instructions confusing, ask for an alternative method.

  • How to transfer a contact list from a cd to the Iphone 4S

    How to transfer a contact list from a CD to the Iphone 4S?

    Import them from the CD to a supported contact application on your computer, then sync them to your phone.

  • How can i print lists from the reminder app

    Does anybody know how to print lists from the Reminder app ?

    There's no print menu in Reminders.
    You can take a screen shot and print that.  Hit command-shift-3 when Reminders is showing, then hit the spacebar, and then click on the Reminders window and you'll get a screen shot on your desktop.  You can then open that in Preview and print from there.
    A better solution though is to just use an iPhone and sync, and have your reminders with you :-)

  • How can i import my contact list from the Nokia Suite to my I phone?

    how can i import my contact list from the Nokia Suite to my I phone?

    Oscar, keep in mind that my suggestion could not be the best one.
    I have a copy of Nokia suite on my Windows XP partition on my Mac, just to test it.
    The second icon on the upper row explains as a syncronisation with Outlook.
    Try to do it and later you should use the iClod manager from Apple and Sync Outlook to ìiClod and to any iPhone iPod and so on.

Maybe you are looking for

  • How do I move music from desktop to iTunes on the same computer?

    I have new music on my Macbook desktop. I want to move it into iTunes.  This was easy with iTunes 10, but it doesn't work with iTunes 11. So how can I manage new music that isn't purchased throught the iTunes store? How can I move music into iTunes?

  • "attempting to copy to the disk C:\ failed. the file name was invalid or...

    "attempting to copy to the disk C:\ failed. the file name was invalid or too long." This was the message that I keep getting after trying to "add folder to library" of multiple tracks from an external hard drive. it only happens after a certain perio

  • Couldn't   Create  Managed Connection

    Hi, I have developed a webdynpro application using webservice.and it works fine in portal... But whenever the connection exceeds its limit,It throws the following Exception Couldn't create ManagedConnection with . {jco.client.passwd=**, jco.client.la

  • Nokia 5300 problem with video playback

    Why is it that all videos received on my new 5300 play for only 23 seconds. Also when viewing video details on screen it states that duration of video is 23 seconds but I know for a fact that the actual duration of the video is longer than that? Can

  • Problems with adressbook entries

    Hi, First of all, i am using iMS 5.0 patch 3.... there are two different languages availables for the users. When i logon with the first and i add a entry in the personal adressbook, if i change the language settings to the other, then i can not see