OutOfMemory - because set lots of html code to string?

Hi,
I got "java.lang.OutOfMemoryError: Java heap space" error message when trying to get a list of objects (it's about 12,000). Below is the code snippet. It seems it has something to do with the part where I set html code (it's saved as blob in table) to string. If I hide this part, I got no error message when geting the list. I have 512RAM. Could someone please tell me how I can set html code to string efficiently, using StringBuilder?
Thanks a lot,
Katie
PreparedStatement st = conn.prepareStatement(sql.toString());
st.setInt(1, orderID);
ResultSet rs = st.executeQuery();
EmailProfile profile = null;
InputStream in = null;
ByteArrayOutputStream out = null;
int c;
int count = 0;
while (rs.next()) {
profile = new EmailProfile();
profile.setAgentID(rs.getInt(1));
in = rs.getBinaryStream(16);
out = new ByteArrayOutputStream();
while ((c = in.read()) != -1){
out.write(c);
profile.setHTML(out.toString());

html in each object is about 9693bytes. In this case, I have 12,000 object. Below shows how I close it. Thanks!
PreparedStatement st = conn.prepareStatement(sql.toString());
st.setInt(1, orderID);
ResultSet rs = st.executeQuery();
EmailProfile profile = null;
InputStream in = null;
ByteArrayOutputStream out = null;
int c;
int count = 0;
while (rs.next()) {
profile = new EmailProfile();
profile.setAgentID(rs.getInt(1));
in = rs.getBinaryStream(16);
out = new ByteArrayOutputStream();
while ((c = in.read()) != -1){
out.write(c);
profile.setHTML(out.toString());
list.add(profile);
              st.close();
              rs.close();
              tmasql.close();
            } catch (SQLException e) {
               System.out.println( e.getMessage());
              throw new Exception(e.getMessage());
            } catch (Exception e) {
              System.out.println("Except:" +e.getMessage());
              throw new Exception(e.getMessage());
            return list;
          }

Similar Messages

  • Print a PDF report having a field(column table) with a HTML code

    hello every one,
    I have a table where a column(varchar2) have HTML code inside it.
    Because all my reports are in PDF format, how can I print this column, when I print in PDF I see all HTML tag and it isn't formatted.
    Have Anyone same problem, could I convert in PDf before I print it?
    Thanks in advance for help

    You need to set "Contains HTML tags" to YES, so that the HTML code is formated in the report.
    It is a property of the field.

  • How to Hide HTML code of web application (applet)?

    hi
    On web, while running application, if user open View\Source from browser, he can see all HTML code (base_jini.html). The problem is that we can't afford to show source code to client, because it has DB connection inf (username/password) as well. How this html code can be hide from client machine?
    I think, i convey my prblom. If not, please run any web application and try to see source code from browser view menu, U will see that all configuration details are visible including db password. I suppose there should be some way to hide these details to client.
    Please help in this regard, i will be very thankful
    regards
    Asif

    Forms Listener Servlet is just another way of setting up forms on the web. The main difference is instead of the client and the Forms runtime talking directly, they do so via the webserver. This means thay you only need to have one port opened in your firewalls (e.g. 80) instead of two (80 and 9000)
    Please read the paper I indicated and this will hopefully explain it all.
    As to the suggestion of using the LOGON built int - this would be a solution but you will have to consider if this is acceptable if you have more that one user since the person running the application would have to identify themselves in some way.
    The other option is do not add the username and password in teh HTML and the default logon dialog will appear.
    Regards
    Grant Ronald
    Forms Product Management

  • Displaying HTML code/document within a SIEBEL applet

    Dear All,
    I have a new requirement which is to integrate an external html document/code within a Siebel's applet in my Home Screen/View. This HTML code is DYNAMIC and it will change depending the user connected. It will give general informations.
    I tried to use a new calculated field in the relevant BC then I added it as control (HTML Type = Field - HTML Display Mode = DontEncodeData - Runtime = Y - Visible = Y) within the applet.
    Unfortunately the field property 'Calculated Value' is restricted to 255 caracters. Everything is fine when the HTML code length is less than 255. When it is greater because teh HTML code is more complex, I can not add a calculated field and the associate control due to the limitation (255 caracters).
    Any idea would be greatly appreciate.
    Thanks a lot.

    One way to get around this limit is to do the following. Split the information you need into several calculated fields and then add them together in one.
    Calculated Display Field = [Information Block 1] + [Information Block 2] + .....
    Where [Information Block n] is a calculated field too.
    Depending on the amount of data and where you need to display the field i.e. form/list applet
    you could use InvokeServiceMethod in a calculated field. Have a look here:
    http://download.oracle.com/docs/cd/B40099_02/books/ToolsDevRef/ToolsDevRef_Operators8.html
    Axel

  • ADF generated HTML code performance issue

    ADF generated code has lot of unnecessary html tags (when you check in Firebug). browser takes time to load the page . It means performance low.
    As a Front end engineer . My aim is to give end user good browsing feeling , he doesn't like to weighting till page loads.
    So from end user perspective page should load faster.
    Normal Html pages and other applications i have full control over html code.
    But in ADF , i don't have full control over all html tags ,which is generated by server dynamically.
    So, can anyone suggest how i can improve my page loading performance ?

    Anil,
    so in real - world terms, what you are saying is that a Ferrari 360 which has a weight of 1,350 kg is slower than a FIAT Panda, which only weights 840 kg. There is a catch to this theory of yours:
    1. ADF Faces is based on JavaServer Faces, which is a component based framework for writing web based applications. Renderer classes are used to build the user front end. It is not the intention of JSF to allow application developers - but component developers - to tweak the generated component output. If you want something lean, use the default JSF HTML component set, which comes extremely light (but also with less functionality - like a Fiat Panda)
    2. Performance is not alone defined by the HTML downloaded to a client - especially given that static HTML can be cached in browsers and ADF supports page templating for this. There are other factors that play in to this like network bandwidth, latency, query time, business logic execution time, image sizes, CSS and JavaScript
    3. The real load in ADF Faces, as in other AJAX frameworks, is JavaScript. Most of the ADF Faces functionality is created dynamically on the client side using JavaScript objects
    4. ADF Faces has more complex components than HTML. If you compare a HTML table with the table rendered in ADF, you see a difference in the look and behavior
    Btw, here's the tuning guide for ADF: http://download.oracle.com/docs/cd/E21764_01/core.1111/e10108/adf.htm#CIHHGADG . You also may want to test and consider partial page navigation, which speeds up page to page navigation big times.
    Frank

  • Why do website forums keep telling me that my messages contain HTML, when they do not contain any HTML code at all?

    I am hoping someone more intelligent than me, can help me out here, as I've got a really infuriating problem.
    I tend to visit a lot of online forums, especially in recent days those at Sky (http://helpforum.sky.com/) and Vodafone (http://forum.vodafone.co.uk/)
    Whenever I log in, and try and post a message, I keep getting a very annoying error message that says:
    "Your post has been changed because invalid HTML was found in the message body. The invalid HTML has been removed. Please review the message and submit the message when you are satisfied."
    The problem is, I never use ANY HTML code, as I don't know what it is. I do use spaces, capital letters, standard punctuation marks, and carriage returns/paragraph breaks. This problem doesn't manifest itself on Internet Explorer, nor Opera, nor Chrome.
    So what's going on please?!

    Please try the steps at [[Websites say that Firefox is outdated or incompatible even though it's the latest version]] before trying anything else, then update Firefox [[Update Firefox to the latest version]]

  • How to get html code out of psd file????

    Hi, I have PS CS6, and just try to work with brackets. Because I can`t extract psd files in my ps version, did it with project parfait. Then I`ve sended that file or better copied the public link into brackets and found my psd file extracted in layers in there. What I miss is the html code, which I`m desperately looking for. So how do I get an html code out of that psd file to create a webpage with brackets, without buying a new ps version...  thanks a lot in advance !

    If you not too familiar with html, you can use the save as web command. When you open the dialog box, towards the bottom you will find preview in Brower. First it will show you the image, but if you scroll down you will see the sample html that was used to create that image in the browser.
    If you need to break it up some you can use slices. Each slice will be its own image.
    The html needs to point to that image on the server.
    This means you need to upload the html and all images to a server. It also means that you will need to manually edit the html so that it has the correct folder location on the server so it can find the images.
    It is one thing to make it work on your computer, it is another story to make sure it works from a server. Usually a typo is what keeps it from working correctly. So pay attention to the url, folders and file names. Keep in mind that folders and files are case sensitive.
    Good luck.

  • How to print html code block

    hi all
    i have a problem about printing my html code block in a loop ...for example;
    <%
    int i;
    for(i=1;i<10;i++)
         out.println("<h1>Hi ALL</h1><h2>Hi All</h2>");
    %>it works well because the html code is just one line.
    but if i want to print very long html code how am i going to print that???
    for example i want to print that html code;what am i going to do now
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="800" height="60" valign="top"><div align="center">
                <span class="style1">Ders Ad&#305;</span>:          
                <%
              dersismi.next();
                %>
              <span class="stilim"><%out.println(dersismi.getString("DERS_ADI"));%></span>
              </div></td>
          </tr>
        </table>thanks for your help

    If you are printing out large blocks of HTML you shouldn't be using any java command. You should just write the HTML like you have in your example.
    The whole point of JSP was that you didn't have to put out.println() statements into a servlet!.
    If you just want to out.println a value into the HTML, consider using the <%= %> expression tag. ie rather than <%out.println(dersismi.getString("DERS_ADI"));%>
    just have
    <%= dersismi.getString("DERS_ADI") %>
    If you want to set up a loop, you can intersperse java and html code, but thats ugly. I would recommend using JSTL custom tags for looping.
    Good luck,
    evnafets

  • [ask] html code for linksys wvc200

    guys, i have project for distance learning site. in this project, there is live streaming using ip camera when the lecturer was teach student. i have bought ip camera linksys wvc200, to make this online and become live streaming site, i must have HTML source code for this to place at php. do you guys have the HTML CODE for this?? really urgent, i need it.. please help me, because i am newbie..

    Hi ekopamungkas and welcome to the Cisco Home Community!
    The WVC200 is now being handled by the Cisco Small Business Support Community.
    For discussions about this product, please go here.
    https://supportforums.cisco.com/community/netpro/small-business
    The Search Function is your friend.... and Google too.
    How to Secure your Network
    How to Upgrade Routers Firmware
    Setting-Up a Router with DSL Internet Service
    Setting-Up a Router with Cable Internet Service
    How to Hard Reset or 30/30/30 your Router

  • Has HTML code changed since DW8?

    I was able to remedy my Hot Spot issue posted earlier by copying code generated from old DW8 files into a DWCS5 page. I've been resorting to this workflow since I upgraded to CS5 because it doesn't seem to generate good code using the so-called automated tools. Has HTML coding lauguage changed since DW8 and is it different for CS5?
    I'm still also not clear about using some of DW's automated tools to generate code. I was told in earlier discussions that I should maually code because DW's various tool sets don't generate good HTML, DW is mostly used as a layout and FTP tool.  Should I rely on Page breeze or a similar HTML editor instead?  And what version of HTML should I use?
    Or should I go back to using DW8?

    Indie767 wrote:
    Has HTML coding lauguage changed since DW8 and is it different for CS5?
    Yes and no. HTML 4.01 and XHTML 1.0 have remained unchanged for the past 10 years. So HTML code generated by DW8 and CS5 is identical. The difference is that Dreamweaver CS5 with the 11.0.3 updater also supports HTML5, which is expected to become the new standard in years to come. Dreamweaver CS5 does not use any of the new HTML5 tags unless you create them manually in Code view.
    I was told in earlier discussions that I should maually code because DW's various tool sets don't generate good HTML, DW is mostly used as a layout and FTP tool.
    I don't know who told you that, but it sounds like a load of nonsense to me. Dreamweaver generates good, clean HTML, provided you use the program correctly. However, having a good understanding of HTML and CSS is a basic requirement of using Dreamweaver efficiently.
    And what version of HTML should I use?
    That's not such an easy question to answer. Some people advocate using HTML5, because it's "the future". Others advise caution, because the HTML5 specification isn't yet complete, and not all browsers support some of its features. To avoid confusion, I would recommend using HTML 4.01 at the moment. HTML5 builds on top of HTML 4.01, so making the transition should be very easy. However, in the final analysis, it doesn't really matter which one you choose. Make a decision, stick with it, and learn how to use it properly.

  • MultiPart Response hide my all my HTML code .

    Hello,
    For my school project, i code a online compiler.
    I finish it but i have a last problem : at the end of the code, i send back the program executable (compiled) trough the ServletOutputStream with a ("multipart/x-zip") header. It work but it hide all the html code of this jsp page !
    How can i fix that ?
    Here is the code of my jsp compiler code :
    http://pastebin.com/769339
    (Look at the end of the code)
    Thx a lot !

    Well you can't output a file AND html content at the same time to the browser, HTTP doesn't support multiple content-types.
    What your code does is:
    - generate the zipdata
    - sets doMail to true
    - sends the zip through e-mail
    - outputs the zip as the response
    - END
    The html is only printed when doMail is set to false (as far as I can tell, the code is one big mess of misaligned curly braces).

  • When is BC going to provide Html codes so we can add BC features to Muse?

    For more a year I see this same question, not one spokesperson from Adobe has given a straightforward answer. Why are you suggesting we go to 3rd party providers like Wazala, Ecwid, Americart to get add on shopping carts to "insert as HTML" on my Muse built website and are paying 38$ a month to host on BC? Both BC and Muse are Adobe products, I don't know the code but I have a reasonable expectations that your products should work together, if I can't add the same shopping cart features from BC to Muse, really all of BC features to Muse why do I need BC in the first place? When is Adobe going to add all the BC widgets to the Muse library? When is BC going to provide the HTML codes for all the BC features that we can copy and paste in the "insert HTML" option on Muse? Why do I have to go to Wazala? Adobe knew when I used Muse I didn't know the code so don't give me some crazy code based solution, I won't understand anyway. That's why I pay for CC and BC for you to provide it. I would appreciate a response. This is stopping me from making money. My muse site is finished, how do I add the shopping cart from BC? Thank you

    There is no widget and there is no indication that this is on the Horizon. I doubt that it will.
    Does not mean you can not because there are people who have accomplished this but you need to understand there is several componants to form eCommerce.
    - You got shopping cart to view cart which can go into any page, layout or template.
    - You have to create your catalogs and products and the layouts for each of those
    - You got the payment page and shopping cart
    - You have to setup your payment gateway.
    With the product layouts you need to insert the features if you want related products, attributes, poplets and configure those as you need based on the site requirements.
    Any extras or abilities would be more custom work and use of Javascript.
    The implementation of eCommerce is on a lot of guide sites out there and in the documentation:
    http://www.bcgurus.com/tutorials/how-to-use-business-catalyst-ecommerce
    http://docs.businesscatalyst.com/
    There is no click click done sollution for Muse.

  • How do I set the response status code for a request in ADF?

    For example:
    I have a page accessible like page.jspx?id=$ID, in which $ID identifies an object stored in a database. The user navigates to page.jspx?id=abc. abc does not exist or has been deleted. I wish to set the response status code to 404 for the page request, like, for instance, https://docs.google.com/spreadsheet/ccc?key=abc does. How do I do this?
    PS: Changing the status code for subsequent partial submits on the page if the object is deleted while the user is on the page (e.g. if the user attempts to delete an already deleted object through a "Delete" button on the page) may also be desirable, but would probably not fit in as well with the ADF lifecycle or be as useful.

    Maybe I should be more specific about the current state of the code. It's something functionally similar in relevant portions to the following. For the purposes of this code, assume the ID maps only to a name, rather than a more complicated object:
    page.jspx looks like:
    <?xml version='1.0' encoding='utf-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
         xmlns:trh="http://myfaces.apache.org/trinidad/html" version="1.2">
         <jsp:directive.page contentType="text/html;charset=utf-8" />
         <f:view>
              <af:document binding="#{pageInitializer.dummyComponent}" title="#{pageData.name != null ? pageData.name : 'Object Not Found'}">
                   <af:outputText rendered="#{pageData.name != null}" value="#{pageData.name}" />
                   <af:outputText rendered="#{pageData.name == null}" value="No object was found at this URL." />
              </af:document>
         </f:view>
    </jsp:root>pageInitializer and pageData are pageFlow-scoped beans with the following code:
    class PageInitializer {
         @Inject private PageData pageData;
         @Inject private NameDao nameDao;
         @PostConstruct
         void initialize() {
              String name = nameDao.getNameById(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id"));
              if (name != null)
                   pageData.setName(name);
              else
                   // TODO: Set status code 404
         public void setDummyComponent(UIComponent dummyComponent) {
         public UIComponent getDummyComponent() {
              return null;
    public class PageData {
         private String name;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
    }The code initializes the data from the database through the initilaizer of a pageFlow-scoped bean with a dummy setter for the document because I read somewhere that that would work, and it seems to work, even though it seems hacky.
    Ideally, the code would render the 404 where it currently says (// TODO: Set status code 404). I realize this may not even be possible given the current architecture, because part of the response body has already been rendered, and I believe, but cannot find a source to cite, that the status code and headers cannot be set after the body has started being rendered. Is there any architecture that would get me this page's functionality (even if it's two JSPXs on the backend (which might be ideal)) and be able to render a 404 for an inexistent object?
    Edited by: 907794 on Feb 1, 2012 3:55 PM
    Edited by: 907794 on Feb 1, 2012 3:58 PM

  • How to see html code in a php file using CS5.5 without using testing server?

    In CS5.5 when I open a page with php extention, DW does not show any html code in design view without me having to set up a testing server. In DW 8 it would open the same files and show me the html in design view. I have no need to test php code, I just need to alter the html. Is there a setting I can change to enable this in CS5.5? Thanks.

    Below is the code. I discovered that if I create a new php document not from
    a template, then I can see the html elements in design view. If I create a
    new page from a template and save it as html, design view still works, but
    if I save a new page from template and save it as php, I only see symbols
    for php and nothing else in design view.
    Thanks for your help on this.
    <!--
    body
    /* ~~ Element/tag selectors ~~ */
    ul, ol, dl { /* Due to variations between browsers, it's best practices to
    zero padding and margin on lists. For consistency, you can either specify
    the amounts you want here, or on the list items (LI, DT, DD) they contain.
    Remember that what you do here will cascade to the .nav list unless you
    write a more specific selector. */
        padding: 0;
        margin: 0;
    h1, h2, h3, h4, h5, h6, p {
        margin-top: 0;     /* removing the top margin gets around an issue where
    margins can escape from their containing div. The remaining bottom margin
    will hold it away from any elements that follow. */
        padding-right: 15px;
        padding-left: 15px; /* adding the padding to the sides of the elements
    within the divs, instead of the divs themselves, gets rid of any box model
    math. A nested div with side padding can also be used as an alternate
    method. */
    a img { /* this selector removes the default blue border displayed in some
    browsers around an image when it is surrounded by a link */
        border: none;
    /* ~~ Styling for your site's links must remain in this order - including
    the group of selectors that create the hover effect. ~~ */
    a:link
    a:visited
    a:hover, a:active, a:focus { /* this group of selectors will give a keyboard
    navigator the same hover experience as the person using a mouse. */
        text-decoration: none;
    /* ~~ This fixed width container surrounds all other divs ~~ */
    .container
    /* ~~ The header is not given a width. It will extend the full width of your
    layout. It contains an image placeholder that should be replaced with your
    own linked logo. ~~ */
    .header
    /* ~~ These are the columns for the layout. ~~
    1) Padding is only placed on the top and/or bottom of the divs. The elements
    within these divs have padding on their sides. This saves you from any "box
    model math". Keep in mind, if you add any side padding or border to the div
    itself, it will be added to the width you define to create the *total*
    width. You may also choose to remove the padding on the element in the div
    and place a second div within it with no width and the padding necessary for
    your design.
    2) No margin has been given to the columns since they are all floated. If
    you must add margin, avoid placing it on the side you're floating toward
    (for example: a right margin on a div set to float right). Many times,
    padding can be used instead. For divs where this rule must be broken, you
    should add a "display:inline" declaration to the div's rule to tame a bug
    where some versions of Internet Explorer double the margin.
    3) Since classes can be used multiple times in a document (and an element
    can also have multiple classes applied), the columns have been assigned
    class names instead of IDs. For example, two sidebar divs could be stacked
    if necessary. These can very easily be changed to IDs if that's your
    preference, as long as you'll only be using them once per document.
    4) If you prefer your nav on the right instead of the left, simply float
    these columns the opposite direction (all right instead of all left) and
    they'll render in reverse order. There's no need to move the divs around in
    the HTML source.
    /* sidebar1 = left */
    .sidebar1
    .content
    .sidebar2
    /* ~~ This grouped selector gives the lists in the .content area space ~~ */
    .content ul, .content ol
    /* ~~ The navigation list styles (can be removed if you choose to use a
    premade flyout menu like Spry) ~~ */
    ul.nav {
        list-style: none; /* this removes the list marker */
        border-top: 1px solid #666; /* this creates the top border for the
    links - all others are placed using a bottom border on the LI */
        margin-bottom: 15px; /* this creates the space between the navigation on
    the content below */
    ul.nav li {
        border-bottom: 1px solid #666; /* this creates the button separation */
    ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that
    your links retain their button look even after being visited */
        padding: 5px 5px 5px 15px;
        display: block; /* this gives the anchor block properties so it fills
    out the whole LI that contains it so that the entire area reacts to a mouse
    click. */
        width: 160px;  /*this width makes the entire button clickable for IE6.
    If you don't need to support IE6, it can be removed. Calculate the proper
    width by subtracting the padding on this link from the width of your sidebar
    container. */
        text-decoration: none;
        background: #C6D580;
    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the
    background and text color for both mouse and keyboard navigators */
        background: #ADB96E;
        color: #FFF;
    /* ~~ The footer styles ~~ */
    .footer
    /* ~~ Miscellaneous float/clear classes ~~ */
    .fltrt {  /* this class can be used to float an element right in your page.
    The floated element must precede the element it should be next to on the
    page. */
        float: right;
        margin-left: 8px;
    .fltlft { /* this class can be used to float an element left in your page.
    The floated element must precede the element it should be next to on the
    page. */
        float: left;
        margin-right: 8px;
    .clearfloat { /* this class can be placed on a
    or empty div as the
    final element following the last floated div (within the .container) if the
    .footer is removed or taken out of the .container */
        clear:both;
        height:0;
        font-size: 1px;
        line-height: 0px;
    TD.mincart {
        font-size: 10px;
        font-family : Verdana;
        position:relative:
        left: 10px;
        top: -30px;
    P.mincart {
        font-size: 10px;
        font-family : Verdana;position:relative:
        left: 10px;
        top: -30px;
    #search 
    #minicartdiv
    P.smaller{
        text-align:center;
        font-size: 12px;
        position: relative;
        top: 1px;
    #tagline {
        font-weight: bold;
        color: #03F;
        height: 18px;
        width: 350px;
        font-size: 18px;
        position: relative;
        left: 10px;
        padding-bottom: 10px;
    #contact {
        font-size: 12px;
        float: right;
        height: 18px;
        position: relative;
        padding-right: 10px;
        font-weight: bold;
        font-family: "Courier New", Courier, monospace;
        padding-top: 7px;
    Call 541-424-5555 Mon-Fri 7am-4pm Pacific Time. Email:
    [email protected]
    Bluetooth and More! No Sales Tax!
    body, this
    is a test
     [Home | index.php] - Store Policies - Products
            - Search - Checkout
            email: [email protected] Call
    541-424-5555</p>
      <!-- end .footer --></div>
      <!-- end .container --></div>
    SSL
    COT("images/cot.gif", "SC2", "none");
    </html

  • Today (16 July 2014) incoming email messages are displayed in plain text otnly. The view message as menu, is set to original HTML, Tried other options too.

    Tried change view message body as (already set to original HTML) . Tried all settings, no change.

    If you can never see remote images because the "Show Remote Images" button is always missing check that permissions.default.image is set to 1 using the config editor.
    http://kb.mozillazine.org/Privacy_basics_%28Thunderbird%29

Maybe you are looking for