Database forLoop to get all records into cmbBox (servlets)

Is it possible because i have not yet find the easiest way to retrieve all record from a specific field from database into a comboBox.
eg: TABLE tableTest
Fields Names (text) has about lets say 5 records
How do i load all those records into a comboBox using servlets??
I am just wondering how this could be done in the easiest and quickest form. Thanks

OK here i have managed to load data into a comboBox its just that it doesent recognise the values ...
ex: First doctor should have a value of 1 from select, so that i could query it.
try {
        String query = "SELECT * FROM Doctor";
        ResultSet rs = statement.executeQuery(query);
        output.println("<FORM ACTION='AdminAssignServlet' METHOD='POST'>");
        output.println("<TR>");
                           output.println("<TD>     Select Doctors Name");
                           output.println("</TD>");
                           output.println("<output>");
                           output.println("<SELECT name='doctor'>");
                           output.println("<OPTION value='0'>Select Doctor</OPTION>");
                           while (rs.next())
                                        doctorId = rs.getString(2);
                                        String tempDocname = rs.getString(1);
                                output.println("<OPTION value="+doctorId+">"+tempDocname+"</OPTION>");
                                output.println("</SELECT>    ");
                                rs.close();
                                output.println("</TD>");
        output.println("</TR>");
      catch ( SQLException sqlException ) {
          sqlException.printStackTrace();
          sqlException.printStackTrace(output);
          output.println( "</table>" );
          output.println( "<title>Error</title>" );
          output.println( "</head>" );
          output.println( "<body><p>Database error occurred. " );
          output.println( "Try again later.</p></body></html>" );
          output.close();
      // List Doctors appointments button
      // List button
          output.println("<TR>");
               output.println("<TD>");
               output.println("<INPUT type=SUBMIT Value='List'>");
                                 output.println("</TD>");
               output.println("</FORM>");
               output.println("</TD>");
               output.println("<TD>");
          output.println("<TR>");
          output.println("</TABLE>");
        //doctor = req.getParameter("doctor");
        try {
          String query = "SELECT * FROM [Consultation], [Procedure] WHERE Consultation.procedureId = Procedure.procedureId AND Consultation.procedureId <> 0 AND Consultation.doctorId = "+doctorId+"";// AND Consultation.surgRequired = 1 ORDER BY date";;
          ResultSet resultRS = statement.executeQuery(query);
          output.println("<table border='1' bordercolor= '#00386E' style='border: Black;'>");
          output.println("<tr>");
          output.println("<td bgcolor='yellow' height='30'><b><font color='blue'> "+doctorName+"'s SCHEDULED PATIENT APPOINTMENTS</font></b>     ");
          output.println("</tr>");
          output.println("</TABLE>");
          output.println("<table border='1' bordercolor= '#00386E' style='border: Black;'>");
            output.println("<THEAD>");
            output.println("<TR bgcolor ='alicegreen'>");
            output.println("<TH>Doctor ID</TH>");
            output.println("<TH>Patient ID</TH>");
            output.println("<TH>Procedure</TH>");
            output.println("<TH>Date</TH>");
            output.println("<TH>Time</TH>");
            output.println("</TR>");
            output.println("</THEAD>");
            while( resultRS.next() ) {
              output.println("<TR>          <TD bgcolor='aliceblue'>" +resultRS.getInt( 2 )+"</TD>"+
                                        "<TD bgcolor='WHITE'><a href='myPatientAppServlet?consid="+resultRS.getString( 1 )+"'>Load me!</a></TD>"+
                                        "<TD bgcolor='alicegreen'>" +resultRS.getString( 15 )+"</TD>"+
                                        "<TD bgcolor='alicegrey'>"+resultRS.getString( 10 )+"</TD>"+
                                        "<TD bgcolor='alicegrey'>"+resultRS.getString( 11 )+"</TD>"+
                            "</TR>");
              output.println("</TR></TD>");
            resultRS.close();

Similar Messages

  • Not getting all records in pagination

    I am also have a problem getting all records in the report as the post on Apr. 21,2004. My reports pagination stops at 500. When I set the 'max row count' to 100000. The pagination at the bottom of my page disapears. When I leave 'max row count' empty, it only goes from 1-500. No way to view records past the 500th record.
    I see there was a post on Apr. 21, 2004 about the same thing but it did not specify a fix or work around or if I'm missing a setting. (also tried the log off/on but did not help).
    *My pagination Scheme is 'Row Ranges 1-15 16-30 in select list(wiht pagination)'
    *My report has 1000+ records.
    Thanks, Paula

    The actual number of rows supported by the select list depends on how many rows you show on each page. If you go with the default of 15 rows, you would be able to use the select list with close to 5000 rows. If you increase the number of rows per page, the select list will work with even more rows.
    If the select list can't be used, it may make sense to consider using the "row ranges with set pagination" style. Set pagination lets you navigate from one set to the next instead of one page to the next, so you can navigate through your result set a lot quicker.
    However the best option for reports with that many rows would be "row ranges x-y", without showing the total number of rows. The reason is that the report renders a lot faster if you don't have the total number of rows calculated. In order to better be able to find certain records, I would recommend a search field on your report page that lets you filter the result set.
    Hope this helps,
    Marc

  • How get all record from master and matching record from detail

    hi master
    sir i have master detail table
    i have many record in master table but some record in detail table how i get
    all record from master and matching record from detail
    such as
    select m.accid,m.title,d.dr,d.cr from master m, detail d where m.accid=d.accid
    this query not work that get only related record i need all record from master
    please give me idea
    thanking you
    aamir

    hi master
    sir i have master detail table
    i have many record in master table but some record in
    detail table how i get
    all record from master and matching record from
    detail
    such as
    select m.accid,m.title,d.dr,d.cr from master m,
    detail d where m.accid=d.accid
    this query not work that get only related record i
    need all record from master
    please give me idea
    thanking you
    aamir
    select m.accid,m.title,d.dr,d.cr
    from master m, detail d
    where m.accid=d.accid (+)The outer join operator (+) will get you all the details from master and any details from the detail if they exist, but the master details will still be got even if there are not details.
    Note: Oracle 10g now supports ANSI standard outer joins as in:
    select m.accid,m.title,d.dr,d.cr
    from master m LEFT OUTER JOIN detail d on m.accid=d.accid

  • HT1473 When downloading a CD album, if it contains different artists, the album is split up into separate albums/icons. How do I get all songs into one album (just like the original CD)?

    When downloading a CD album, if it contains different artists, the album is split up into separate albums/icons. How do I get all songs into one album (just like the original CD)?

    Generally, in iTunes, all you need to do is fill in an appropriate Album Artist to keep things together. For older iPods each track from the same album should have the same artist, or be marked as a compilation where appropriate. For iOS devices you may need to go to Settings > Music > Group By Album Artist > On.
    For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

  • Unable to getting all records

    hi
    i  am new to bo 4.1 and i am having  source system (orcial)
    in sours level i have a table  in  6 lake record.when i use same table in webi i am unable to getting all record.i don't have any filters in report and object level.my table contain all dimensions only
    i changed in universe level no of records display and report level as well..
    s.s(6 lakes) = target report level( 6 lakes)?
    i am using sap bo 4.1 version
    pls do need ul help

    Hi Sandeep Mishra,
    thanks for your response, actually its executing successfully,but when i am set no of display records for example-5000 to 10000 ...it showing in report level..but when i want all record around 6 lakhs records..it taking time but out put showing empty..
    see the below my objects
    i need all objects at a time....this objects have table in source level 6 lakh ..i want same records in report level like 6 lakhs..
    i changed query properties in display of no of records as well as univer level..
    let me know in case of any clarty..
    thanks

  • How to get all records of 0041 for a given PERNR

    I have to display Most Recent Hire and Original Hire date.
    So I am using this below code:
      0041 - Date Specifications
        rp_provide_from_last p0041 space pn-begda pn-endda.
        IF pnp-sw-found EQ '1'.
          MOVE: p0041-dat01 TO wa_final-dat01,
                p0041-dat03 TO wa_final-dat03,
                p0041-dat02 TO wa_final-dat02.
    But for few PERNRs we are having wrong data and below is the explanation from my functional guy:
    I figured out the above when I ran the report for all employees and noticed some dates were out of sequence.  The reason for the code change is because Payroll has to input NR in the P0041-DAR** field (used in payroll calculations to allow additional contributions to Savings Plans for employees who are near retirement) and it automatically places this future retirement date in P0041-DAT01.
    So if I see at PA0041 for a given few PERNRS, am having couple of records and the last record is for the retirement calculations and hence am getting wrong dates into my display. I need the first record for this kind.
    Thanks
    Kiran

    Hi,
    here is the piece of code using field symbols for accessing dates from pa0041....
      FIELD SYMBOLS
    FIELD-SYMBOLS:<f_dar01> TYPE ANY,
                            <f_dat01> TYPE ANY,
                             <f>       TYPE ANY.
    form read_pa0041 .
      DATA:    l_date               TYPE dardt,
               l_date_type          TYPE datar.
      CLEAR : v_data  ,
              v_date  ,
              v_days  .
      v_cnt = 1.
      DO 12 TIMES.
        CONCATENATE 'p0041-dar' v_cnt INTO v_data.
        CONDENSE v_data NO-GAPS.
        ASSIGN (v_data) TO <f_dar01>.
        IF <f_dar01> = 'U5'.
          CONCATENATE 'p0041-dat' v_cnt INTO v_data.
          CONDENSE v_data NO-GAPS.
          ASSIGN (v_data) TO <f_dat01>.
          v_date = <f_dat01>.
          EXIT.
        ENDIF.
        v_cnt = v_cnt + c_1.
      ENDDO.
    then you can use the date fetched in v_date  as per your requirement..
      IF NOT v_date IS INITIAL.
    I hope u will get some help
    Thanks & Regards
    Ashu SIngh

  • CUBE Not getting All records from DSO

    Hi Experts ,
    We have a situation where we have to load data from a DSO to a Cube . The DSO contains only 9 records and while we r loading the data into cube , the cube is only getting 2 records . Thus 7 records are missing. Also The Cube contains more Fields  than DSO. in the transformations , for the extra fields we have written end routine and those extra fields will get data by reading master data .. Any pointers how to get the missing records or what is the error ...
    Sam

    Why multiple threads ????

  • How to get all records created this month?

    Ok I'm trying to write a query that would get records that were created this month or later but not in the past.
    So today is Nov 16th 2009
    I need to look for all records created from 11/2009 and onward (>11/2009)
    Any ideas?

    Do you have any field like "create_date" on that table ? Here is simple qry
    with t as ( select 1 as id,to_date('01-OCT-2009','DD-MON-YYYY') as create_date from dual
    UNION
    select 2,to_date('11-OCT-2009','DD-MON-YYYY') from dual
    UNION
    select 3, to_date('02-NOV-2009','DD-MON-YYYY') from dual
    UNION
    select 4, to_date('01-NOV-2009','DD-MON-YYYY') from dual
    UNION
    select 5, to_date('13-DEC-2009','DD-MON-YYYY') from dual)
    select * From t
    where CREATE_DATE >= trunc(sysdate,'MON')Edited by: rkolli on Nov 16, 2009 1:23 PM

  • How to get all records using Invoke-webrequest?/Why Invoke-webrequest returns only first 2000 Records?

    invoke-webrequest content returning only 2000 records though it has around 4000 records in web api.
    The same url if I give in excel oData Data feed I am getting all the records.
    See the below script
    Script:
    $QueryResult= (Invoke-WebRequest -Uri $ODataURI -UseDefaultCredentials)
    [xml]$xmlResult=$QueryResult.content
    foreach($obj in $xmlResult.feed.entry.content.properties)
    $Name=$obj.Name;
    $IsAvail=$obj.isAvail.'#text';
    $PGroup=$obj.PGroup
    I am exporting the above result as a CSV file and my CSV file contains only 2000 records. 
    But,  $xmlResult.feed.Count --> it Shows 4000 Records.
    The same Odata url if I give in excel oData Data feed I am getting all the 4000 records.
    So Please help me how can I get all the records using power shell.
    Thanks
    A Pathfinder..
    JoSwa
    If a post answers your question, please click &quot;Mark As Answer&quot; on that post and &quot;Mark as Helpful&quot;
    Best Online Journal

    Hi Jo Swa(K.P.Elayaraja)-MCP,
    Would you please also post code which is used to export the records?
    In addition, to use the cmdlet invoke-RestMethod to work on ODate feeds, please refer to this article:
    Interacting with TechEd NA 2012 Schedule using PowerShell v3
    I hope this helps.

  • Query to get all records were AMNT1 AMNT2

    Hi,
    I have two fields Field1,Field2 and two Key figures-AMNT1,AMNT2. I want to get all the records for which AMNT1 > AMNT2.
    Any clues or solutions will be appreciated.
    Thanks
    Simmi

    Hi simmi
    You can put condition for this requirement in the query designer.
    When you are in the query designed have a formula with Boolean operation statement "is greater than", as shown.
    AMNT1>AMNT2
    now go to condition button and add one condition for this formula. the condition can be 'key figure'= formula name, Operator = 'Equal to' and value = '1'.
    Aply this condition and execute query with this condition active.
    regards
    rahul

  • Get all records in multi selected master child tables

    Hi,
    I am using JDeveloper 11.1.1.4 version and using ADF-BC in my project.
    I have a simple master child[one to many] relationship in my project.
    In my view page,I display this master child [Ex: EmpVo1--->DeptVo2] as tables.
    I have multi-slection enabled for master table.
    My requirement is that,on multi selecting the rows in master tables,I want to get all the child records in my backing bean.
    that is if a master row has 3 child records and another master row has 4 child records and on multiple selection of these two records in master table,I should get all the child records in my backing bean.
    I need this to implement cascade delete functionality.
    Following is sample piece of code
    1) called on selecting the rows in master table
    public void onRSCGrpSelect(SelectionEvent selectionEvent) {
    // Add event code here...
    ADFUtil.invokeEL("#{bindings.RscGroupVO1.collectionModel.makeCurrent}",
    new Class[] { SelectionEvent.class },
    new Object[] { selectionEvent });
    RowKeySet rowKeySet = (RowKeySet)tblRSCGrp.getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)tblRSCGrp.getValue();
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData =
    (JUCtrlHierNodeBinding)cm.getRowData();
    Row row = rowData.getRow();
    System.out.println("\n" +
    row.getAttribute(0) + " :: " + row.getAttribute(1) +
    " :: " + row.getAttribute(2));
    System.out.println("Displaying Child Records");
    displayChildRecords(row.getAttribute(0));
    2. private void displayChildRecords(Object rscGrp) {
    ViewObject rscMapVo = getRscMapViewObj();
    RowSetIterator rsI = rscMapVo.createRowSetIterator(null);
    while (rsI.hasNext()) {
    Row row = rsI.next();
    System.out.println("\n" +
    row.getAttribute(0) + " :: " + row.getAttribute(1) +
    " :: " + row.getAttribute(2));
    rsI.closeRowSetIterator();
    But the problem is that ,it is always giving me the last selected rows child record details
    Please suggest the error I am doing.
    Thanks,
    Praveen

    Your problem is that you use makecurrent, which should not be used on a multi select table. Next if you have master detail relationship you should have a view link between them. In this case you can expose a method in you master to get the related child row. No need to get the VO itself as you can use the child iterator accessors to get the child record.
    public void onRSCGrpSelect(SelectionEvent selectionEvent) {
    // Add event code here...
    RowKeySet rowKeySet = (RowKeySet)tblRSCGrp.getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)tblRSCGrp.getValue();
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData =
    (JUCtrlHierNodeBinding)cm.getRowData();
    Row row = rowData.getRow();
    //cast to the right row class
    EmpEmpVoRow empRow = (EmpEmpVoRow) row;
    // now you cann access the child row iterator
    RowSetIterator it = empRow.getDepVO();
    //now you cna iterate over the child rows
    System.out.println("\n" +
    row.getAttribute(0) + " :: " + row.getAttribute(1) +
    " :: " + row.getAttribute(2));
    System.out.println("Displaying Child Records");
    //use hte child rows here
    }Not sure if the code compiles out of the box (doing this on the train :-)
    Timo

  • Getting all contacts into icloud

    How do I get "All Contacts" that are on my iPhone 4 over to my iCloud.com account?  The group "All iCloud" on my phone  has many less contacts than the All Contacts.  I'm concerned that if I lose my phone or the data gets corrupted, I'll lose all the extra contacts.  I don't have an Outlook account, but that seems to be the only type of account you can sync with.
    Thanks, Ron

    Winston Churchill's solution looks promising, but seeing your experience I'm reluctant to try it. Can anyone tell us how to merge the contents of "All Contacts" on the iPhone (a non-iCloud group) with one of the iCloud groups? (I have a couple; do not remember how they got put into iCloud while several other groups on the phone, including the big "All Contacts", did not.
    I apologize for my ignorance. I'll be grateful for guidance.

  • Full update not getting all records from PSA to ODS

    Dear BW Masters,
    I am working with MM module. Iam using standard extract structure 2LIS_02_ACC
    Iam doing full update. Getting full data 1300 records in to PSA. But getting only 298 in to my ODS. I tried changing fields in to KEY FIELDS AND IN TO DATA FIELDS in my ODS
    But could not get data.
    Pls help me..i have dead line before that i need to complete report on the same.
    Its happening with the other HDR and ITM extractors.
    PLs help me..

    Hello,
    Look at this example:
    R/3 Record:
    CustNo | Name | Order | Amount
    1234 | Customer1 | Order 1 | 100
    1235 | Customer2 | Order 2 | 200
    1234 | Customer1 | Order 3 | 300
    If Cust.No is Keyfield, In BW you will get 2 records
    1234
    1235
    If Order No is Key field, you will get 3 records.
    It is not necessary to get the same no of records as they are in R/3.

  • Sccm database query to get all hardware info

    hi all 
    i have a sccm db i need to get all system hardware info where sql server is installed
    result set should be
    sql version
     system processor info 
    can u help on this 

    You can use a query based on v_GS_installed_Software and v_GS_Computer_System SQL views, something like:
    select
    from
    v_GS_installed_Software  vIS
    join
    v_GS_Computer_System vSC
    on
    vIS.ResourceID=vSC.ResourceID
    where
    vIS.ProductName0 like '%SQL Server%'
    Ofcourse the Hardware inventory has to be enabled and collected first.

  • LOV an SQL : how to configure a select list to get all records

    Hello,
    I am using Oracle 10g with APEX 2.0.
    Here is my question:
    I have a report and I am using 3 text fields and a select list to search through a join of two tables. The select list is composed of a "list of values" and the parameter, which is used in the SQL-sentence, has a numeric value.
    Result table after the join operation looks like this:
    Field1 Field2 Field3 Field4 (By assuming the field3 is the one which used in the select list.)
    21a this 1000 bn
    21a that 1001 vb
    33c thus 1012 ct
    What I want to do is to set another parameter-value pair in the select list to let user choose the "ALL" of the mentioned items in the select list so that the search will return all the records without having taken this select list-field into consideration.
    Is it possible to do it with LOV and SQL? Do I need any other functions? or configurations?
    Thanks in advance,
    Sedef

    Hi user630478!
    I always use a select list with submit and the option to get a NULL-Value for such things. To solve your problem do the following things:
    1.) Create two named LOVs. One as you already did and another one for all values.
    2.) Your select list with submit should be configured to show a NULL-Value e. g. it shows ALL with the value 0.
    3.) Create two conditional branches that work together with your select list. One that show the normal results if a user has clicked on a normal value and the second should act only if a user has clicked on ALL.
    4.) Write a process that switches the LOVs in your select list from one to the other. This process should only be fired if the second conditional branch has been actived.
    Maybe if I understood right that's what you want to know.
    yours sincerely

Maybe you are looking for

  • How to include file path in footer

    I need to add file paths to a pdf I have created.  Does anyone know how?  I know that there are JavaScript ways, but I am not even sure what a Java Script is. Thanks for any insight!

  • IPhone 4 Syncing Error- Too Many Computers

    I get an error message that says my iPhone has been cynced to 5 computers and it won't sync to my new MacBook Pro. Is there any way to Unsync it from computers I no longer have access to? We're talking about computers from three years ago, before I e

  • Large number of objets - log miner scalability?

    We have been consolidating several departmental databases into one big RAC database. Moreover, in tests databases we are cloning test cells (for example, an application schema is getting cloned hundred of times so that our users may test independentl

  • Repeat Group Header on Every Column

    Hello all.  I have a simple two column layout report with three groups.  I would like the group headers to repeat at the top of each column similar to the way they repeat on each page when the "Repeat Group Header On Each Page" check box is clicked. 

  • Is there a keyboard shortcut for cycling/toggling between layers in Illustrator CC?

    I'm trying to improve my workflow by finding/customizing a key command to cycle through my layers panel without clicking in Illustrator CC. In Photoshop, this command is super easy: opt + [ or ], while moving a layer above the selected one is command