How to Fetch & Store Richtext in MySql

Dear Friends ,
I am Developing a System in Java - Swings , I am Using MySql as Backend .
How can I store & retrieve Richtext in MySql.
I am Using TextPane in Swing as the RichText Tool in Java .
I collected Some information & which says to use BLOB / CLOB Objects to store Rich text .
It will be Helpfull for me if you give me Ideas & Suggestions in this regard.
I need the ways & means for storing & retrieving Richtext in MySql.
Thanking you

You can store RichText as BLOBs in the database. Take a look at the PreparedStatement class and the following API's:
void setBinaryStream(int parameterIndex, InputStream x, int length)
void setBlob(int i, Blob x)

Similar Messages

  • How to fetch data from Mysql with SSL.

    I am using jdk1.5 and mysql 5.0.
    How to fetch data from Mysql with SSL
    I am using url = jdbc:mysql://localhost/database?useSSL=true&requireSSL=true.
    It shows error. how to fetch

    I have created certificate in mysql and checked in mysql.
    mysql>\s
    SSL: Cipher in use is DHE-RSA-AES256-SHA
    but through ssl how to fetch data in java.

  • What is a cube? how we store data in that? how we fetch data from cube?

    Hi,
    What is a cube? how we store data in that? how we fetch data from cube?
    Regards.
    venkat

    >
    venkey B wrote:
    > Hi,
    >
    >
    > What is a cube? how we store data in that? how we fetch data from cube?
    >
    >
    > Regards.
    >
    > venkat
    Hi Venkat,
    I guess you mean an infocube from the SAP BI product. I propose to look at the forum for Business Intelligence to find your answers.
    E.g. SAP POS DM writes the sales data in infocubes.....

  • How To Store DataTime In MySQL

    I would like to store a DateTime in MySQL.
    I am using the class PreparedStatement, and the method setDate().
    But it just store the date, the time is 00:00:00
    (ie. 2003-06-25 00:00:00)
    How can I store it?
    Thank you for help!

    Use setTimestamp() instead, with a java.sql.Timestamp object. Confusingly, a java.sql.Date object contains only a date, unlike a java.util.Date object which contains both a date and a time.

  • How to fetch data from different sources into one source (like into Ztable)

    hi friends,
    As per our client requirements they want to develope an Inventory and an Ontime delivery report in BO on top of Oracle database.
    Situation is some thing like they have ECC 6.0.and they want to collect all inventory and ontime delivery data at one place.According to me that could be one Ztable in which we can gather all data.Apart from that they are going to use Data Integrator in which they can directly fetch the data from R/3 system(They dont want to have BI system) and put all data in Oracle DB.On top of ORacle BO person can develop BO reports.
    My question is how to fetch all data at one place and what are the tables going to be use.
    kindly help me out as its very important project.
    Thanks
    Abhishek

    The following is my standard reply to those who need to get old data from a backup in one account and add it to another account.  The method described here may be applied to your case.  It would be a bit of a long process, though.
    When connected to the account you want to GET data from, Go to Settings>iCloud and turn all data that is syncing with iCloud (contacts, calendars, etc.) to Off. 
    When prompted choose to keep the data on the iPhone. 
    After everything is turned off, scroll to the bottom and tap Delete Account.  Next, set up a new iCloud account using a different Apple ID and turn iCloud data syncing for contacts, etc. back to On.  When prompted, choose Merge.  This will upload the data to this new account.
    Note that this only affects the "Apple data" like contacts, calendars, reminders, etc.  Many third party apps also use iCloud to store data files there.  These files may be lost in the process, unless the apps also keep the data locally on the device.
    NOTE:  Photos in the photo stream (if you use it) will not transfer to the new account.  It is advised that you save the photos to a computer before performing the account switch. 

  • How to fetch some certain records at a time

    Hi everyone,
    I dont know how to fetch some records at a time,
    for some reason,there is not enouht memory.so I cant
    fethch all the records at a time.
    example, every time I only want to fetch 10
    records. Does anyone know that?
    thanks
    Krussi

    I think you may be getting setFetchSize(int) and setMaxRows(int) confused. I may have added to the confusion with my breaking out of the loop comment.
    setFetchSize(int) gives the driver a hint as to how many rows it should store in memory at a time internally, ie. within the driver. It has no real effect on how you write your program at all. Its only purpose is to limit memory usage by the driver. To limit the rows returned, use setMaxRows.
    For example, assume a result set has 20 rows and you use:
    rs.setFetchSize(5);
    while (rs.next()) {
       System.out.println("Rows: " + (++count));
    }  You still get a count from 1 to 20. However, internally the driver is only holding in memory 5 records at a time, after the 5 returned it will discard those and get the next 5. So instead of holding 20 rows, its only holding 5 at a time. If you change rs.setFetchSize(5) to rs.setMaxRows(5) you will only get a count from 1 to 5, the rest are silently discared and rs.next() returns false.
    Check your documentation to see if your driver supports the method. I believe many drivers don't. If not, I believe there is no way around multiple queries. Even if there is no rowid, as long as you order your queries you should be able to start again where you left off.
    Disclaimer: Both drivers I commonly use do not implement setFetchSize(int). Someone let me know if I've fudged something here.
    Good Luck

  • How to Upload/Attachment File  in MYSQL    ADF???

    HEY Guys...
    How to Upload/Attachment File in MYSQL ADF???
    Regards Ninja,

    You need to provide more information.
    Which jdev version do you use?
    Which ui technology?
    I see two question to be answered:
    1) load the attatchments ADFrc af:inputFile (http://technology.amis.nl/blog/2297/adf-faces-file-uploading-it-is-really-that-simple)
    2) store the loaded data in the DB -> mysql doc or google should have the needed information
    Timo

  • How can I take minutes from mysql date format

    how can I take minutes from mysql date format??
    example 10:30:00 is stored in my sql and I want to create 3 variables which will store hours, minutes and seconds..
    Cheers..

    "use application date format" is the choice you want.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How to fetch presence in Lync 2013 from SQL server (using query)

    We are running Lync 2013 setup with 5 FE and 2 BE SQL (mirrored) servers.
    How can i get presence information for our users by script or SQL queries?
    My Concern is to fetch out current presence information of a list of users (CSV file) by script (Powershell or SQL query) for automation purpose. So that one need not to go to Lync 2013 (or anything) Client for every single user, to check their corresponding
    presence.
    E.g Say a service desk agent is handling tickets of 200 users per day. So it will be time consuming for him/her to go to Lync 2013 client and check presence for every user. It would be better for SD agent to operate, if we could make a script to fetch presence
    status for the list of 200 users.
    We will fetch the information when required and send a mail to him/her.
    i have asked this question under Presence and IM forum.
    https://social.technet.microsoft.com/Forums/en-US/ef6287d1-e474-48ab-a411-f3813d256145/how-to-fetch-presence-information-in-lync-2013?forum=lyncprofile
    been suggested to post it here.

    Create a Store procedure which will give you integer value according to presence status:
    USE [rtc]
    GO
    /****** Object:  StoredProcedure [dbo].[GetAvailability]    Script Date: 05/01/2015 10:36:35 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author:  <sudipta samanta>
    -- Create date: <02.01.2015>
    -- Description: <fetch presence information of user>
    -- =============================================
    CREATE PROCEDURE [dbo].[GetAvailability]
    @_Publisher varchar(50)
    AS
    DECLARE
    @agrregate_state varchar(500),
    @availability varchar(50),
    @index_first int,
    @index_last int,
    @index int
    BEGIN
    SET NoCount ON
    set @agrregate_state = (select top 1 Data from dbo.DiagPublisherDataView(@_Publisher) order by LastPubTime desc);
    set @index_first = (select CHARINDEX('<availability>',@agrregate_state));
    set @index_last = (select CHARINDEX('</availability>',@agrregate_state));
    set @index = @index_first + 14;
    set @availability = (SUBSTRING(@agrregate_state,@index,@index_last - @index));
    return CONVERT(int, @availability);
    END
    GO

  • How to fetch particular segment of records?

    Hi all,
    My last question is how to limit the rows returned. This time my question is how to fetch particular segment of records from DB table?
    In detail, if one table has 95 records, which method can be used to fetch #71-80 record only, not fetch #1-80 first and abandon the preceeding 70 ones?

    There are a few methods:
    - Set firstResult and maxResult on the JPA Query, this is normally the best option. Depending on your database this will best optimized to only select these rows.
    - Use a Cursor, in EclipseLink 1.1 there are QueryHints for doing this, see org.eclipse.persistence.config.QueryHints.
    - Select all of the results, and store them in your app or http session, and scroll through them in memory on next/previous.
    - Select just the ids, and store them in your app/page or http session, each page select the batch of object with the ids.
    - Use an order-by and critieria to limit your results to a specific amount.
    James : http://www.eclipselink.org
    http://en.wikibooks.org/wiki/Java_Persistence

  • Error while fetching more than 1000 mysql records

    I'm trying to fetch data from a MySQL database through PHP to a Flex application. When there are more than 1000 records in the resultset, the FaultEvent is returned. When I limit it to 1000 records, no problem at all. Any ideas? Code below:
    public function OldCustomerService(method:String=HTTPRequestMessage.POST_METHOD, resultFormat:String=RESULT_FORMAT_E4X, showBusyCursor:Boolean=true)
                super(null, null);
                this.requestTimeout = 0;
                this.method = method;
                this.resultFormat = resultFormat;
                this.showBusyCursor = showBusyCursor;
            public function getAllProspects():void {
                this.url = ALL_PROSPECTS_URL;
                this.addEventListener(ResultEvent.RESULT, getAllProspectSuccess);
                this.addEventListener(FaultEvent.FAULT, DAOUtil.communicationError);
                var oldCustomersToken:AsyncToken = this.send();

    It works with fewer records so it would be weird if it would be a php or mysql error. Seems to me Flex isn't waiting until everything is in. To give you a better idea of what's happening, I'll post the PHP code:
    <?php
    * Created on 19-mrt-10
    * To change the template for this generated file go to
    * Window - Preferences - PHPeclipse - PHP - Code Templates
         include '../../application/general/php/general.php';
         // connect to the database
         $mysql = mysql_connect(DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD) or die(mysql_error());
        // select the database
        mysql_select_db( DATABASE_NAME );
        // query the database to retrieve all customers.
        $query = "SELECT * FROM stores";
        $result = mysql_query($query);
        //start outputting the XML
        $output = "<result>";
        if($result) {
            $output .= "<success>yes</success>";
            $output .= "<stores>";
            // create a store tag for each retrieved store
            while($customer = mysql_fetch_object($result)) {
                $output .= "<store>";
                $output .= "<naam>$customer->naam</naam>";
                $output .= "<adres>$customer->adres</adres>";
                $output .= "<postc>$customer->postc</postc>";
                $output .= "<wpl>$customer->wpl</wpl>";
                $output .= "<land>$customer->land</land>";
                $output .= "<telprive>$customer->telprive</telprive>";
                $output .= "<telbureau>$customer->telbureau</telbureau>";
                $output .= "</store>";
            $output .= "</stores>";
        } else {
            $output .= "<success>no</success>";
            $output .= "<error>\n";
            $output .= "Reason: " . mysql_error() . "\n";
            $output .= "Query: " . $query ."\n";
            $output .= "</error>";
        $output .= "</result>";
        print ($output);
        mysql_close();
    ?>
    When the error occurs, I get a <success>yes</success> and yet again the Fault error is thrown. Again, with fewer records, no problem.

  • How to fetch file from app. server without complete filename?

    Hi,
    In my report I have to read data from txt file on application server.
    My file name on App. server conatain system id and date and time stam.
    my file path :- /User/IDD/S10009112007101525
    here,'User'  is dirctory
            'IDD' is folder in directory
            'S100' is system id
             '09112007' is date
             '101525'  is time in hour,miniute,second format.
    From my program I can only pass directory , Folder name,System Id,Date only. I don't have time value in my program.
    So please tell me how to fetch files without having time stamp value from app. server.
    Plz send me exact code.It's urgent.
    Message was edited by:
            Manisha Kadam
    Title was edited by:
            Alvaro Tejada Galindo

    Do you want to return the file to the user on click of button or something?
    Then, use web_show_document with http link which you are speaking about.
    Else download the file to client using Webutil.

  • How to fetch year till date value for earning for current ,last and year

    hi,
    how to fetch year till date value for earning for current ,last and year before that from payroll result
    plz reply soon,
    pratyush

    Dear Pratyush,
    Pick this from CRT.
    Use LDB PNPCE & Fire event GET PAYROLL &
    then you can pick from CRT.
    Hope this helps.
    Kindly reward in case useful.
    Regards & Thanks,
    Darshan Mulmule

  • How to fetch accounting document number from known material document number

    Hi,
    Using MIGO transaction, by giving mblnr(material document number) as input, I get accounting document number by clicking FI document.I have to add this accounting document number in my report for corresponding known mblnr(material document number) values.
    My question is how to fetch the accounting document number present in MIGO to add in my report program.
    I used the xblnr(Reference Document Number) which is present both in mkpf and bkpf tables to fetch values.
    I extracted xblnr values with known mblnr values from mkpf (Header: Material Document table).
    and then extracted belnr(accounting document number) from bkpf (Accounting Document Header table) by using xblnr values.
    But the query is running for a long time.
    Is there any other method  to extract the values in a simpler way.
    Kindly advise.
    Thanks and Regards,
    Sanjeev

    I had the values of xblnr and some other fields such as mblnr, budat etc in wi_item table.
    I created a new internal table i_xblnr and got down those values.
    And then created a new internal table i_belnr and tried to get values of belnr in it.
    The code I wrote is given below:
    IF not wi_item[] is initial.
    loop at wi_item.
       at new xblnr.
        ws_xblnr-xblnr = wi_item-xblnr.
         append ws_xblnr to i_xblnr.
       endat.
    endloop.
      select belnr xblnr from bkpf into table i_belnr for all entries in i_xblnr where xblnr = i_xblnr-xblnr.
    ENDIF.
    Kindly look after it.Thank you.
    Regards,
    Sanjeev

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

Maybe you are looking for