How to display the contents of the database values which are retrived.

how to display the contents of the database values which are retrived in servlets and i am able to display the contents in the servlets and if forward to jsp using requestdespatcher,the values are to be shown in jsp one below the other.please suggest me in these........the servlet code is as shown
while(rs.next()){
                    buffer.append(rs.getString(1));
                    buffer.append(rs.getString(2));
                    buffer.append(rs.getString(3));
                    buffer.append(rs.getString(4));
                    buffer.append(rs.getString(5));
                    buffer.append(rs.getString(6));
                    buffer.append(rs.getString(7));
                    buffer.append(rs.getString(8));
                    buffer.append(rs.getString(9));
                    buffer.append(rs.getString(10));
                    request.setAttribute("result1",buffer);
                    RequestDispatcher rq=request.getRequestDispatcher("/results.jsp");
                    rq.forward(request,response);
in jsp iam using the getAttribute to retrieve the values as shown
<% StringBuffer sb=(StringBuffer)request.getAttribute("result1"); %>
<%= sb %>
but getting the results in the stretch,i need to display the result one below the other.

if you load it all into the buffer that is going to be very difficult. I would suggest loading it into some sort of collection. I like using an ArrayList.
Then pass the arraylist.
you will then on the jsp iterate through the arrayList using what every you want.. el, logic tags, scriplets.
so something like
ArrayList arrayList = new ArrayList();
while(rs.next()){
arrayList.append(rs.getString(1));
//or possibly an arrayList of String arrays
//maybe using nested for loops.  Inner for loop adds result to string[] then //outer adds string[] to arrayList.
//can be done any number of ways based on your expected result set.

Similar Messages

  • How to display link content on the the same sharepoint page on click event

    "How to display link content on the the same sharepoint page on click event"
    Detail:
    we are using a document library where all html files are stored/uploaded.  we would like to display/open the html file on the same sharepoint page where all the files are listed.
    Thanks.

    Use jQuery and set the target to self to the anchor tag
    Regards,
    Sairam Avacorp Technologies

  • How can I convert (or switch) the RGB percent values from the LR histogram into RGB values which are shown e. g. in PS/CameraRAW?

    In LR 5.5 (same in previous versions) the RGB values in the histogram are shown in percent (relativ) values. I prefere to see the absolute values, but I can`t find any way to switch. Maybe this option is intentional disabled, because LR works in 16-Bit mode this would result in values up to 2^16. But as i compared the relativ values from LR with the absolute values from PS i run into a conversion problem. The following example shows the differences:
    CameraRAW : RGB, 128,0,0
    Lightroom: RGB, 43,8%, 19,0%, 6,2%
    CameraRAW: RGB, 0,128,0
    Lightroom: RGB, 29,8%, 47,5%, 17,5%
    Mainly i have two questions:
    1. Is there any possibility to change the percent RGB values in LR to absolut values?
    2. How can i convert CameraRAW values to LR values (see above)?

    TThe reason that a design decision was made from the beginning of LR to show only the percentage values was that RGB values are dependent on the color space and the LR histogram and numerical readout are derived from the Develop module's display space which is a hybrid color space with ProPhoto RGB primaries and the sRGB TRC. Thus the numerical values in the display would be different from the exported RGB image (in an orthodox space) and it was feared that this would be misleading. When soft proofing was introduced, because it involved converting the display to an orthodox space, it became possible to use the 0-255 scale in that mode.

  • I have Photoshop cs6 Ext on an ASUS laptop. How can I increase the font size of the contents of the FILTER Panel situated on bottom left of screen. The font size is extreamly small and almost unreadable. I have changed display parameters, not the resoluti

    I have Photoshop cs6 Ext on an ASUS laptop. How can I increase the font size of the contents of the FILTER Panel situated on bottom left of screen. The font size is extreamly small and almost unreadable. I have changed display parameters, not the resolution, to no avail.
    David.

    Paragraph breaks are good for readability. ;-)
    Have you noticed any difference between your MacBook and others at the Apple store? Wondering whether this is a configurable setting at the system level, i.e., DPI.
    You can default Firefox to a larger zoom level to avoid having to zoom every page. You'll still be able to adjust the size for individual sites as needed. It sounds as though you are aware of these add-ons:
    * Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
    * NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/
    There are some discussions about changing coming in Firefox 22 (I think) to address higher density displays like the Retina display. So perhaps there will be a built-in setting to address this in the future.

  • Nested Table: How to display formatted text in the form ?

    Hi,
    Scenario:
    I have a nested table, say TAB1, containing another table TAB2 which holds the formatted text.
    Sample data
    Entries in TAB1:
    Column1       Column2(TAB2)
    Text1         Data_from_tab2
    Text2         Data_from_tab2
    Text3         Data_from_tab2
    Requirement:
    The requirement is to display the data in TAB1 as it is maintained.
    Trials:
    I am aware of the fact that we can transfer the content of the nested table (in this scenario, TAB2) in another table(of type TLINE) defined as a global variable in the interface of the form. Then in the context area, we can define a 'TEXT' node and bind it to the table and choose the 'Dynamic text' for the 'text type' attribute and maintain the other atrributes.
    But this approach cannot solve the issue as it is a nested table.
    Kindly suggest how can I resolve this issue.
    Regards
    s@k

    Hi,
    if its like colum1, column2 (tab2).
    you can represent column2 as a nested table in the form. and put these tables structure intoa subform of type flowed.
    then you can have the required format.
    the same can also be acheived using nested subforms instead of tables.
    example of such scenario is PO & line items.
    po number1 , items 1
                          item 2
                          item 3
    po number2 , items 1
                          item 2
                          item 3
    hope this helps you.
    Cheers,
    Sai

  • Update the database table with the content of the internal table

    Hello!
      I have the next form:
      FORM erase_data.
    SELECT * FROM zadrress INTO CORRESPONDING FIELDS OF TABLE itab_adrress.
      DELETE TABLE itab_adrress: FROM zadrress,
                                 WITH TABLE KEY adrid = '456'.
      WRITE 'The information after the DELETE operation'
      COLOR 2.
      LOOP AT itab_adrress INTO wa_adrress .
        WRITE:/
               wa_adrress-adrid COLOR 5,
               wa_adrress-name COLOR 7,
               wa_adrress-email COLOR 5,
               wa_adrress-depart COLOR 7,
               wa_adrress-display COLOR 5.
      ENDLOOP.
      SKIP.
    LOOP AT itab_adrress INTO wa_adrress.
       MODIFY zadrress FROM wa_adrress.
       COMMIT WORK.
       IF sy-subrc = 0.
         WRITE 'OK !'.
         SKIP.
       ELSE.
         WRITE 'FAIL !'.
         SKIP.
       ENDIF.
    ENDLOOP.
      MODIFY zadrress FROM TABLE itab_adrress.
      UPDATE zadrress FROM TABLE itab_adrress.
    TRANSPORTING adrid, name, email, depart, display.
    INSERT zadrress FROM TABLE itab_adrress ACCEPTING DUPLICATE KEYS.
    PERFORM display_data .
    ENDFORM.                    "erase_data
    I see that my record is deleted  when I display the records from my internal table, but
    now I want to delete the record from database table.
       For that I want to move the content of the modified internal table in the database table. You can see the methods I tried (some of them commented), but nothing seems to work.
    Any advice ?
    Thank you.

    FORM erase_data.
    SELECT * FROM zadrress INTO CORRESPONDING FIELDS OF TABLE itab_adrress.
    DELETE TABLE itab_adrress: FROM zadrress,
    WITH TABLE KEY adrid = '456'.
    WRITE 'The information after the DELETE operation'
    COLOR 2.
    LOOP AT itab_adrress INTO wa_adrress .
    WRITE:/
    wa_adrress-adrid COLOR 5,
    wa_adrress-name COLOR 7,
    wa_adrress-email COLOR 5,
    wa_adrress-depart COLOR 7,
    wa_adrress-display COLOR 5.
    ENDLOOP.
    SKIP.
    LOOP AT itab_adrress INTO wa_adrress.
    MODIFY zadrress FROM wa_adrress.
    COMMIT WORK.
    IF sy-subrc = 0.
    WRITE 'OK !'.
    SKIP.
    ELSE.
    WRITE 'FAIL !'.
    SKIP.
    ENDIF.
    ENDLOOP.
    <b>DELETE FROM zadrress.</b>  "Make this change and try
    MODIFY zadrress FROM TABLE itab_adrress.
    UPDATE zadrress FROM TABLE itab_adrress.
    TRANSPORTING adrid, name, email, depart, display.
    INSERT zadrress FROM TABLE itab_adrress ACCEPTING DUPLICATE KEYS.
    PERFORM display_data .
    ENDFORM. "erase_data'.

  • How can i see the content of the cache server 2 ?

    How can i see the content of the cache server 2 ?

    Caching server is backed by an sqlite database.  If you want to see what you currently have downloaded, you can glean some information by accessing the database.  Use this command to connect to the database:
    sudo sqlite3 /Library/Server/Caching/Data/AssetInfo.db
    Once connected, you can use .tables to see the tables in the database but the one with the most information appears to be ZASSET.  Use:
       select * from ZASSET;
    To list the current contents.  You will get a series of records similar to the following:
    26|1|5|0|868991341|402440412.42114|402507221.969799|ffaf18a45cd5dd5e853233629036 5767|30B9108D-ABE4-4061-A2E0-42E91301249B|Fri, 06 Sep 2013 18:21:34 GMT|/content/downloads/14/11/091-9722/ognnjd4fno85m4pbapjtnv23b7rf1mkufx/OSXUpd Combo10.8.5.pkg|
    Note that the final value is a human recognizable name of the package.  However, you may also see items like this:
    125|1|4|0|11622676|406739736.508118|406739736.508125|4f1f9b08b32f9f6211e4569604b 1efef|481BF3D9-99BB-415F-ADB6-860EDD24B08E|Thu, 14 Nov 2013 10:24:30 GMT|/us/r1000/032/Purple6/v4/37/a3/d2/37a3d2f7-2594-8224-7eda-712f17a3fd8b/mzps 6227198657217312566.D2.pd.ipa|
    This is an iOS application.  There is no real way that I know of yet to match the package name (mzps6227198657217312566.D2.pd.ipa) to a product name.
    When finished, type .quit
    R-
    Apple Consultants Network
    Apple Professional Services
    Author "Mavericks Server – Foundation Services" :: Exclusively available on the iBooks Store

  • URGENT !!! How to fecth the content of the mail

    HI All,
    I having a problem regarding how to fetch the body of the mail as well as attachment of the mail.
    i get sender name, subject but i having the problem how to fetch the content of the mail.
    i used
    System.out.println(message[msgno].getContentType());
    but it showing
    javax.mail.internet.MimeMultipart@480457
    it won't showing the content.
    How can i fetch the content !!!!
    Please help
    I fetching accessing the mail server using "imap"
    By
    Ravi
    email : [email protected]

    Code which i used
    import java.io.*;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.lang.*;
    import java.lang.Object;
    public class GetMessageExample
         public static void main(String args[]) throws Exception
              String host = "...";
              String username = "....";
              String password = ".....";
              // Create empty properties
              Properties props = new Properties();
              // Get session
              Session session = Session.getDefaultInstance(props, null);
              // Get the store
              Store store = session.getStore("imap");
              // Connect to store
              store.connect(host, username, password);
              // Get folder
              Folder folder = store.getFolder("INBOX");
              // Open read-only
              folder.open(Folder.READ_ONLY);
              // Get directory
              Message message[] = folder.getMessages();
              for (int i = 0, n = message.length; i < n; i++)
                   // Display from field and subject
                   System.out.println("From : "+message[0].getFrom()[0]);
                   System.out.println("Subject :"+message[0].getSubject());
                   // Display message content     
                   System.out.println("ContentType :"+message[0].getContentType());
                   System.out.println("Content :"+message[0].getContent());
              // Close connection
              folder.close(false);
              store.close();
    i got this output :
    From : Ravi Lal <[email protected]>
    Subject :Testing
    ContentType :multipart/alternative;
    boundary="----=_Part_63386_12145160.1189402168311"
    Content :javax.mail.internet.MimeMultipart@480457
    As i having only one mail in my inbox.
    I able to fetch everything from, subject but i fails to get the content i.e text of the mail.......
    What i do ????????
    !!! Help Me !!!
    Ravi
    Edited by: Ravi_InSun on Sep 13, 2007 10:51 AM

  • To display the contents of the table in sf

    HI,
    I have a requirement to display the contents of the table on the smart form main window.
    Like there is a dic table containing 8 rows . i would like to to display all the 8 rows on a smartform main window.
    Help me how to solve this,

    Hi,
    Kindly follow the below steps,
      Go with a transaction code : smartforms
       Enter the form name like : ysma_forms1 and create with proper description
       From the left side window there will be a form interface to provide table .....
       Go for tables option
       table_name like table_name(ref.type)
       Pages and window-> page1-> main window
       Go to the form painter adjust the main window.
      Select main window and right click --> go for create loop
      Name: loop1, desc: display loop.
    Internal table ktab into ktab.
    select loop right click -> create a text
    name  : text1,  desc: display text.
    Go to change editor.
    Write the mater what ever you want and if you want to display data from the table write the table fields as follows:
    &ktab-<field1>&    &ktab-<field2>&
    save  & activate then execute ,, scripts will generate a function module  like : '/ibcdw/sf0000031' copy this function module and call in executable program...
    For that
    1.  go with abap editor se38.
    2.  table: tablename.
    3.  parameters: test like tablename-<field1>.
    4.  data itab like tablename occurs 0 with header line.
    5.  select * from tablename into table itab where field1 = test1.
    6.  call function '/ibcdw/sf0000031'
    7.  tables
         ktab = itab.
    Save and activate the program ( ^f 3).
    Now run the program ( f 8)
    Hope this will help you
    Regards,
    Vijay Duvvada

  • I have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code?

    i have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code? thank you!

    i inherited the website. It’s for a non-profit and is not very
    sophisticated, and neither am I in webdesign. It currently has multiple
    pages that are identical except for that body section, so whenever i change
    the navigation (in the sidebar) I have to update every html page.  I want
    to have one basic page, and just call in the different body content based
    on the link the user selects from the nav bar. How can i do that using a
    script? i am using Dreamweaver.
    ~ in love and light ~
    Jeannie
    On Sat, Feb 7, 2015 at 4:07 AM, Ben Pleysier <[email protected]>

  • I got some books from the itunes store and put them into my library.  I created a playlist so that I could burn them to cds.  The title is there but no contents.  It won't even play the playlist.  How do I get the contents of the book?

    I got some books from the itunes store and put them into my library.  I created a playlist so that I could burn them to cds.  It won't even play the book, there are no contents.  How do I get the contents of the book?

    I'm guessing this is a problem unique to me as there have been no replies at all...  Thanks a bunch folks

  • Hi, I have a new cell phone, I wanted to give my iphone to my father, instead of deleting the content on the iphone I have deleted the entire iphone. It starts up no more. iTunes will not recognize the iphone. How do I get my old data back onto the phone?

    Hi, I have a new cell phone, I wanted to give my iphone to my father, instead of deleting the content on the iphone I have deleted the entire iphone. It starts up no more. iTunes will not recognize the iphone. How do I get my old data back onto the phone?

    Place the device in DFU mode (google it) and restore as new.

  • How to import and make the content of the original PDF document editable and preserves the pdf appearance and retains existing fields and formatting in LiveCycle

    Can someone tell me how I can see my content (artwork and text) after I import  it into LiveCycle Designer ES4?  I like to import and make the content of the original PDF document editable; preserves the pdf appearance and retains existing fields and formatting, then allow me to do the modifications and save it back into the original PDF document with changes. I have tried everything but still cannot see my content(artwork and Text) of my original PDF after importing it into LiveCycle. All I see are is a blank page with the formatting and layout of where my artwork and text should be. I like to see everything if possible so after I make my change I will know how it will look when I save it back into the PDF and open it in Acrobat Reader.

    Can someone tell me how I can see my content (artwork and text) after I import  it into LiveCycle Designer ES4?  I like to import and make the content of the original PDF document editable; preserves the pdf appearance and retains existing fields and formatting, then allow me to do the modifications and save it back into the original PDF document with changes. I have tried everything but still cannot see my content(artwork and Text) of my original PDF after importing it into LiveCycle. All I see are is a blank page with the formatting and layout of where my artwork and text should be. I like to see everything if possible so after I make my change I will know how it will look when I save it back into the PDF and open it in Acrobat Reader.

  • How to create a jar having the contents of the jar in a byte array?

    Hi,
    I have a server and client application. My server returns the contents of the jar in the form of byte array to the client on a particluar method call. Now at the client end, i want to reconstruct the jar to be used. How do I do this?
    The server uses the JarInputStream to read the contents of the jar to be returned. I have tried using the JarOutputStream, but looks like this works fine if we have spearate class files to be added to the jar. Now that I have the contents of the jar itself, how do i recreate the jar?
    Can anyone please help me with this?
    Thanks
    Rajani

    Have you ever gotten the raw byte copy to work? If so, how?
    I download a jar via InputStream and save into a jar file via fileoutputstream. It always gets corrupted in the process. The new Jar file has the exact same number of bytes, but doesn't get past the Manifest on a -tvf. In fact, Winzip can open it fine, but can't extract. So close...yet so far.
    Here is a snapshot of my code:
    BufferedInputStream data1=new BufferedInputStream(con.getInputStream());
    DataInputStream data=new DataInputStream(data1);
    StringBuffer buf=new StringBuffer();
    try{
    while((theChar=data.read()) != -1)
    { buf.append((char)theChar); }
    } catch (Exception z){ logger.info("UpdateThread.read Done Reading jar file");}
    data.close();
    File newFile = new File("C:/MyJar.jar");
    FileOutputStream outstream2 = new FileOutputStream(newFile);
    DataOutputStream outstream1 = new DataOutputStream(outstream2);
    BufferedOutputStream outstream = new BufferedOutputStream(outstream1);
    byte [] bytes = buf.toString().getBytes();
    logger.info("Bytes of new Jar file = " + bytes.length);
    int i;
    for(i=0;i<bytes.length;i++){
    outstream.write(bytes);
    outstream1.close();
    outstream.close();
    Any ideas where I'm going wrong?

  • How to read the contents of the Uploaded file ?

    hi @,
    I have used the File upload and Download UI elements as per the tutorial available. Now my requirement is to read the contents of the file and transfer it to the Backend system.
    How can I achieve the desired fucntionality.
    Thanks in advance,
    Regards,
    Amit

    try this code to store image file in back end system.
    IWDResource res=wdContext.currentMyDataElement().getPictureres();
              InputStream in=res.read(false);
              ByteArrayOutputStream bout=new ByteArrayOutputStream();
              int length;
              byte[] part=new byte[10*1024];
              while((length=in.read(part))!=-1)
              bout.write(part,0,length);
              in.close();
    pstmt.setBytes(8,bout.toByteArray());
    If it is other than image file like word or text then try this in action
    IWDResource resource = wdContext.currentResElement().getResorce(); // your existing handle to the upload resource type
                try {
                   InputStream stream = resource.read(true);
                   byte b[]= new byte[1000];
                   stream.read(b);
                   String str = new String(b);
                   int i=str.length();
                   wdContext.currentContextElement().setOut(str);
                   wdContext.currentContextElement().setSize(i);
                   wdContext.currentResElement().setResourceurl(
                        wdContext.currentResElement().getResorce().getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal()));
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    The in back end field where u store the file should be byte array.
    Regards,
    H.V.Swathi

Maybe you are looking for