Problem in retreiving from database and viewing it in browser--urgent

hai,
i have develped an application using swings where the mails received from client and reply posted will be pasted in JEditorPane. all the mails,query and reply will be stored in database.
then iam retrieving the mails from database and displaying it in browser using table data.(Just like forum). Iam using encodehtmltag function to omit the html tags that r present in the mail data.
when i display it in browser it extends a page horizontically. how to avoid this. how to word wrap. one of my friend asked me to set number of character to be displayed per line. i did that. but problem is i could see the word break . i have set 90 characters to be displayed per line. i dont want to break the word. for eg., if the end string of a line is regarding it is displayed like this---reg and then arding in next line. how to avoid this.
please help me iam breaking my head with this for past few days.

If the field is a Date in your database, you can use the ResultSet.getDate() method, which will return a java.sql.Date (which extends java.util.Date).
You can then use SimpleDateFormat to format it the way you like.
See the API doc for more details.

Similar Messages

  • Create link when retreive from database

    Hi, I created database called "Homepage", and i created table
    called "homenews" inside of "homepage" database.
    I also created two column which is "News_Name" and
    "News_URL".
    I use dreamweaver and is works great when i retreive from
    databse, but i want to change to have link, let say first colmn for
    "news_name i put cnn, and second colmn for News_URL i put
    www.cnn.com, my question is that how i can write php code to create
    url link of "www.cnn.com" on the text called "cnn" when retreive
    from database!
    is this is correct code!
    <?php echo '<a
    href="'.$row_HomeNews[News_URL].'">'.$row_HomeNews[News_Name
    ].'</a>'; ?>
    if so when why I'm getting errors!
    AM

    Alidad wrote:
    > Hi, I created database called "Homepage", and i created
    table called "homenews"
    > inside of "homepage" database.
    > I also created two column which is "News_Name" and
    "News_URL".
    >
    > I use dreamweaver and is works great when i retreive
    from databse, but i want
    > to change to have link, let say first colmn for
    "news_name i put cnn, and
    > second colmn for News_URL i put www.cnn.com, my question
    is that how i can
    > write php code to create url link of "www.cnn.com" on
    the text called "cnn"
    > when retreive from database!
    >
    > is this is correct code!
    >
    > <?php echo '<a
    href="'.$row_HomeNews[News_URL].'">'.$row_HomeNews[News_Name
    > ].'</a>'; ?>
    >
    > if so when why I'm getting errors!
    What errors are you getting?
    For the looks of your code, if you have www.cnn.com in the
    News_URL column, then the link you're generating will not go to
    CNN. You need to include the
    http:// as part of your link. Even though you
    can copy and paste www.cnn.com into the browser and go to the
    correct place, if it is used as a link in a page, then it has to
    have the
    http:// to go to be able to leave the current
    site and go to the correct place.
    Danilo Celic
    | Extending Knowledge Daily :
    http://CommunityMX.com/
    | Adobe Community Expert

  • Jasper report on HTML when one image loaded from database and for the other

    How to generate jasper report on HTML when one image loaded from database and for the other we give a image path
    My code
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
              exporter = new JRHtmlExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
              exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, strImageInputDirectory);
         exporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, strImageOutputPath == null ? "." : strImageOutputPath);
         exporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.TRUE);
         exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
         exporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
              exporter.exportReport();
              byte[] bdata = ((ByteArrayOutputStream) baos).toByteArray();
    Can any one help pls
    Message was edited by:
    ameet.au

    hey sorry for posting it in this forum.
    but do u have sample code for making it work.. since i am able to do it on PDF format(image from Database and another stored in the webserver) using
    byte image[] =(byte[]) outData.get("image");
                        ByteArrayInputStream img = new ByteArrayInputStream(image);
                        hmimg.put("P_PARAMV3", img);
    print = JasperFillManager.fillReport(reportFileName, hmimg, jrxmlds);
    bdata= JasperExportManager.exportReportToPdf(print);

  • Code that handles a set of questions from database and place it on JSP

    Hi,
    How to write a code that handles a set of Quiz questions from database and place it on JSP page..
    Thanks in advance
    Haritha

    975033 wrote:
    Hi,
    I hav got the answer from you r previous link, but not completly. I need help regarding on how to do code that handles a set of questions from database and place it on JSP.
    Any help is highly appreciated.Yes but what kind of help do you expect to get? What kind of help do you think is possible through something as cold and distant as a forum, where you clearly require personal guidance and tutoring?
    If you are going to answer "example code", I should warn you that the answers are not going to be to your liking.

  • To fetch XML files from database  AND regarding barcodes

    Hi !!
    I am very new to this forum...this is my first mail to this forum...
    1.) Actually I would like to know how to fetch XML files from database and then how to get the datas from that XML files???Right now i am using struts frame work...If u anyone send some sample code for this one,it is Very helpful for me.....
    2.)Using java ,how to generate Barcodes?In database I have Some serial number.While I try to display the serial number in Front end ,I should display with Barcode Corresponding to that number.Plz send some sample codes if u have.....
    Thanks in ADVANCE,

    PonJAVA wrote:
    Hi !!
    I am very new to this forum...this is my first mail to this forum...
    1.) Actually I would like to know how to fetch XML files from databaseStart with a JDBC tutorial. Check out DAO Pattern and Hibernate as well.
    and then how to get the datas from that XML files???Google Java & XML (there are many ways to do this
    Right now i am using struts frame work...Okay...
    If u anyone send some sample code for this one,it is Very helpful for me..... You haven't provided any detail regarding your task so there's no way anyone could post code for you.
    2.)Using java ,how to generate Barcodes?Search Google
    In database I have Some serial number.While I try to display the serial number in Front end ,I should display with Barcode Corresponding to that number.Plz send some sample codes if u have.....Try a JSP/Servlet tutorial.

  • Retreiving a date from database and converting it into a string in a format

    hi all,
    iam having a date field which stores values ,for eg:2002-04-26 00:00:00.i want to retreive the date and i want to convert in a String in dd/mm/yyyy format.how can i do so.plz explain me..........thanks in advance

    If the field is a Date in your database, you can use the ResultSet.getDate() method, which will return a java.sql.Date (which extends java.util.Date).
    You can then use SimpleDateFormat to format it the way you like.
    See the API doc for more details.

  • Data Modeler: Problems with importin from DDL and Designer

    I have a few problems with importing models from Designer and DDL:
    1. Can I import spatial indexes from Designer or DDL file? An index does appear in the model but it doesn’t seem to be a spatial index. When trying to import from database, the index doesn’t appear in the model at all.
    2. Is it possible to import sdo_geometry data types from DDL file? I haven’t succeeded with it, instead the column's data type appears unknown.
    3. Sometimes import from DDL files (that are generated with DM) failed with nothing appearing to the model. I haven’t figured out why that happens. I didn’t receive any error message, the model just opened empty.
    4. DM doesn’t seem to recognize public synonym creation from DDL. View log gives the following message:
    <<<<< Not Recognized >>>>>
    CREATE PUBLIC SYNONYM TABLE1
    FOR TABLE1
    5. Sequences lose their properties when importing from Designer. They only have a name but but start with, increment by and min/max values are empty in DM. Importin from DDL works fine.
    I’m using data modeler version 2.0.0 build 584

    Hi Alex,
    There is newer version of Data Modeler (3.0 EA2) and it is free
    You can download it from here
    http://www.oracle.com/technetwork/developer-tools/datamodeler/ea2-downloads-185792.html
    Regards
    Edited by: Dimitar Slavov on Dec 9, 2010 2:15 AM

  • Permissions disappearing from tables and views in SQL Management Studio

    As a CRM person, I sometimes have to update the database to cope with custom reports that I have written. Usually, I will
    Go into SQL Server Management Studio 2008
    Open the database
    Locate either the table or the view
    Right click on permissions
    Add in the role or user that's needed
    Grant them Select permissions
    This allows the report in CRM to access the database and this works.
    The problem I have is that after a certain amount of time, the user or role will disappear from the permissions meaning that the report will not run. Sometimes, this can be as soon as a couple of days or it can be months. It happens on views more than tables
    and, whilst it's not too difficult to put the permissions back, it is annoying for the users.
    I don't use SQL Server Management Studio very regularly, only to write a few queries and set up these permissions so I'm not sure if there's anything else in there that might be doing this. All suggestions would be very welcome.
    Thanks.

    Sounds like some process is removing/resetting permissions periodically
    if you are using enterprise edition you could try to catch this using auditing
    http://technet.microsoft.com/en-us/library/dd392015%28v=sql.100%29.aspx
    otherwise you would need some other custom tracing mechanism (SQL Trace, Extended Events, catching statements.. not fun)
    Andreas Wolter (Blog |
    Twitter)
    MCM - Microsoft Certified Master SQL Server 2008
    MCSM - Microsoft Certified Solutions Master Data Platform, SQL Server 2012
    www.andreas-wolter.com |
    www.SarpedonQualityLab.com

  • Problem of Teststand3.1 database and microsoft SQL Server 2000 personal edition

    I have a problem when using teststand database function with Microsoft sql server 2000. the error(seen in attached screenshot3.jpg) is:
    "An error occurred calling 'LogResults' in 'ITSDBLog' of 'DBLog 1.0 Type Library'
    An error occurred executing a statement.
    Schema: Generic Recordset (NI).
    Statement: UUT_RESULT.
    [Microsoft][ODBC SQL Server Driver][SQL Server]unable to insert NULL value to column "ID", table "test.dbo.UUT_RESULT";This column is not alowed to be blank. INSERT Failed. Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
    [Microsoft][ODBC SQL Server Driver][SQL Server]terminated.
    Source: TSDBLog"
     Here I listed my proceess.
    1, Configure in SQL Sever, please see attached screenshot0.jpg
       a, Open SQL
       b, build a new database with the name of test
       c, import the data from "C:\Program Files\National Instruments\TestStand 3.1\Components\NI\Models\TestStandModels\Database\TestStand Results.mdb"
    2, Configure Microsoft SQL sever: please see attached screenshot1.jpg
       a, Open windows Control Panel and select "Data Sources (ODBC). Under system DSN tab, add a SQL server data source
    3, Configure teststand database option, see attached screenshot2.jpg
       a, configure logging option, enable
       b, configure datalink
       c, select schemas of "Generic recordset (NI)
       d, No change on the tabs of "statements" and "Columns/Parameters"
    4, run an seqence file with the proess model of SequentialModel.Seq.
    Attachments:
    Screenshot.zip ‏425 KB

    Thanks Scott,
      The database function is OK now after I changed imported tables in SQL Sever.
      Actually, I once tried anothor method that you refered by using the scripts
    located at: <TestStand>\Components\NI\Models\TestStandModels\Database\SQL Server Create Generic Recordset Result Tables.sql. Attached is the error screenshots, please help me on this.
    Thanks
    Jacky
    Attachments:
    Error.jpg ‏59 KB

  • Retrieve URL from database and navigate through command button

    I am new to ADF and Jdeveloper. In our database we store the URLs to our help/FAQ webpage in a table. What I would like to do is retrieve this URL from the database and code a command button to navigate the user to this URL but I am not sure how to accomplish this and have not had any lucking searching for a solution. I have created a view object for the table that contains the URL. Many thanks in advance.

    Hi,
    Welcome to OTN.
    You can create a view object based on the table (on which you have the URL stored).
    Create a goButton (Instead of a command button) and bind the column (which stores the URL) to the destination property of the go button.
    Something like
    <af:goButton text="Help" id="gb1"
                        targetFrame="_blank" destination="#{bindings.URL.inputValue}"/>-Arun

  • XSD from Database table/view/procedure

    Hi all,
    Does anyone know of a tool or framework which enables generation of XSD's out of a Database table/view/procedure?

    Hi Naval,
    It depends on whether you created a BOL model for your Z-table or not. If you don't have a BOL model, then all you can do is use a value node. In that case, you need to add attribute that you want to show in the value node, read the values from the z-table and add them to the node. You can create method(s) in view implementation class to read values from database table and fill the context node. From where these methods should then be called will depend on your requirement.
    Regards,
    Shiromani

  • CRM order details from database and buffer

    Hi,
    I am working on a scenario where i need to read the order details from buffer and database also to compare the changed values in one of the action class. I have tried with CRM_ORDER_READ and CRM_ORDER_READ_OW. CRM_ORDER_READ is giving the details from buffer and CRM_ORDER_READ_OW is not giving me any resluts. To compare the old and new values i need to read the details from buffer and database also. Please suggest me the function modules to use.
    Thanks,
    Rajinikanth G

    I'm using similap comparion for some opportunity fields. There I'm using function modules 'CRM_OPPORT_H_READ_DB' and 'CRM_OPPORT_H_READ_OW and it's working fine.
    So I guess _DB and OW function modules should be ok. I'm not sure, but I think I also had problems a while ago with using module CRMORDER_READ_OW. Maybe try to find some other OW function that could give you wanted values. CRMORDER_READ_OW is very large fm, so try using CRM_ORDERADM_H_READ_OW for header data and CRM_SCHEDLIN_I_READ_OW for items and so on. There are function modules for nearly all data groups.
    Regards.

  • Communication Channel Problem while reading from database

    Hi,
    I have a JDBC to IDoc scenario.
    The database here is AS400 and i need to read data from AS400 tables and send it to SAP IDocs.
    The communication channel picks up the data from AS400 based on the query and builds the IDocs.
    Suddenly the channel stops working and it doesnt pick up the data from AS400. When we change the name of the Communication Channel, it again starts picking up the data but again for some period.
    It sounds really strange as this is happening only with AS400 database and not it works perfectly when connecting to an SQL Server database.
    Please help me out in resolving this issue.
    Regards
    Kiran.

    Hi Kiran
    Can you check the Notes 717376 ,990892 and try to implement.
    Some tips:
    This error is caused by some optimization in the IBM VM for AS400 which can be disabled through the JIT compiler settings. The following VM setting -Dos400.run.mode=jitc must be set, according to note 717376. Any other value for this setting, as e.g. jitc_de can cause the described problem
    Also, please share the trace, so that, it would help to identify the problem.
    Also try to change the property in Vis Admin
    "cluster-data" -> "Global server configuration" -> "managers" -> "ApplicationThreadManager" -> "MaxThreadCount" ( like 400)
    Regards
    Chilla

  • Problem Posting Receipt From Production and Issue for Production

    Hi Everyone,
    I am posting Receipt from Production and Issue for Production through DIAPI in SAP Business One 2007A SP00 PL03.
    I am using following lines of code
    oDocument.Lines.SetCurrentLine(0);
    oDocument.Lines.BaseEntry = int.Parse(BaseEntry);
    oDocument.Lines.Quantity = double.Parse(Quantity);
    lRetCode = oDocument.Add();
    The Document adds perfectly but when I open the document in SAP Business One i am not able to see the Order Number at Line level on which this document was Based.
    I identified the problem being Order Number Column being binded to BaseRef field hence form is not able to Show the Order Number and we cannot set BaseRef via DIAPI since the property to set that field is not exposed.
    I donot want to update the table through a Recordset Update Query. I would appreciate if the property to set that field is exposed by SAP or any other workaround can be put forward by anyone who has faced the same problem.
    Thanks
    Kapil

    Do you need to set
    oDocument.Lines.BaseType = 17 (if this is sales order)
    and then baseentry = baseentry....etc
    If you bind the base entry correctly it should alwasy shows the base document on both database as well as front end. I have never had any problem with this
    Sincerely

  • [webdynpro] How to get the data from database and store in Excel sheet

    Hi All-
    I am developing an application in Webdynpro and I need to provide a URL ( link ) which if clicked , need to collect the data from Database ( SQL Server ) and puts in an Excel Sheet corresponding fields and opens the sheet.....
    Please look into this issue and help me out......
    Regards,
    Cris

    Hi Cris,
    Add-on to wat santosh has pointed to:
    Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)
    (Or) If you have implemented your logic to get Database records below Blog should guide you in opening an excel with ur records.
    Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)
    Regards,
    N.

Maybe you are looking for