Urgently needed(data transfer on sockets)

hello friends,
I m in need of java code to read text and graphics(lines,circles etc.)from JTextPane and then to transfer this data on sockets to a client.
IF anybody can help,I'll be highly thankful.I need it urgently.

i did the follwing when i had a similar requirement...i used java.util.vectors and passed them over sockets to the other end. the advantage of doing this was that I inserted a string ('string_msg') if any text messages were sent or ('graph_pts') if Point objects of the circle or line was sent, as the first element of the vector and the next element was the text-object(StringBuffer) / object[](incase of Point objects) itself.
here is the piece of code to send the vector...
try {
            ucon = (new URL(serverURL, serverPathStr)).openConnection();
            ucon = setUcon(ucon);
            objectoutputstream = new ObjectOutputStream(new BufferedOutputStream(ucon.getOutputStream()));
            objectoutputstream.writeObject(obj);
            objectoutputstream.flush();
            objectinputstream = new ObjectInputStream(new BufferedInputStream(ucon.getInputStream()));
            obj1 = objectinputstream.readObject();
            objectinputstream.close();
            objectoutputstream.close();
        catch....in the case above, the server simply returns a string "OK_recd" which is recd as a sent confirmation via obj1.
Note: the server &/ client should also use ObjectInput/Output Streams to recieve the object and type cast the object recd to Vector.
the first element in the vector (used as a handshake) to identify the next element in the vector...
hope this helps!

Similar Messages

  • URGENT - BLOB data transfer

    Hi:
    I have an Apex application that includes a couple of standard reports that display BLOB columns as images.
    I copied the blob table to the new database via a database link using insert into <remote table> select * from <local table>. The data was transferred and in SQL Developer I can view the images from the BLOB column.
    However, the newly deployed apex application shows the report but not the images. This is true for all of the reports theat display images.
    Is there a problem with transferring the BLOB data via the DB link. Must I transfer the data another way?
    Please help. This is very urgent.
    Regards,
    Bruce

    Hi:
    Thanks for your reply.
    My query for the standard report has used the following to display the image:
    , '<img style="border: 4px solid #CCC; -moz-border-radius: 4px; -webkit-border-radius: 4px;" '||
    'src="'||
    apex_util.get_blob_file_src('P90_PRODUCT_IMAGE',i.image_id)||
    '" height="25" width="35" alt="Product Image" title="Product Image" />'
    detail_img
    But this is snow not working in the new application.
    Interestingly, I also have an IR report that does use the data/formal to set the BLOB column formatting, but it too is not working in the new application.
    I even tried to upload a BLOB in the new application but still it does not display in the report.
    Suggestions.
    Thanks
    Bruce

  • Data Transfer with Socket

    Hi,
    we want to transfer some arrays using socket.
    On the server side we send two array (arrays of byte of ~50 Kbytes) with:
    PrintStream out = new PrintStream(client.getOutputStream(), true)
    out.write(Array of byte).
    On the client side we do not receive two stream of data of 50Kbyte, but we receive two or more stream of different size using:
    BufferedInputStream in = new BufferedInputStream(s.getInputStream()) in.read(Msg).
    Server side:
    Send Array1;
    Send Array2;
    Client Side:
    get Stream1;
    get Stream2;
    get Stream3;
    Stream1 = part of Array1
    Stream2 = remaining of Array1 and part of Array 2
    Stream3 = remaining of Array2
    Is it possible to receive each array in one stream each and not fragmented in different stream ??
    What we wanna is:
    Server side:
    Send Array1;
    Send Array2;
    Client side:
    get Stream1 (= Array1)
    get Stream2 (= Array2)
    Best Regs

    I didn't quite understand your post, given your mix of Java code and pseudocode.
    However, I shall attempt to give you some guidance:
    When you say you are using multiple streams, I am assuming that you are only using 1 stream, but reading in from it multiple times.
    With a network connection, delivery over the stream of all the content at one time cannot be guranteed. In practical terms this means that you cannot do the following:
    Server:
    send 50kb of data
    Client:
    receive 50kb of data.
    Close connection.
    What you have to do instead is:
    Server:
    send 50kb of data
    Client:
    read from stream until 50kb of data have been read.
    Close connection.
    For the above to work, you must know that you are expecting 50kb of data. If you don't know how big the data stream is going to be, there are two solutions:
    Solution 1: include length of data in send:
    Server:
    send 2 bytes representing the length of the data (in this case 12bk)
    send 12kb of data
    Client:
    read length of stream (2 bytes. Should give you 12kb).
    read 12kb of data.
    Close connection.
    Solution 2: include batch separators:
    This solution is when you want to send a number of batches down the same line (kindda what you want).
    Server:
    send 50kb of data
    send separator (e.g. '|''|')
    send 34kb of data
    Client:
    read stream until stream is closed, or separator encountered.
    if separator encountered, create new data batch, continue as above.
    The problem with solution 2, is that you now have to devise an appropriate way for escaping the separator. If the separator occurs naturally in the data you are sending, you should escape it on sending, and unescape it on reading in at the other end.
    However, after all of the explanation above, my advise to you is: use the ObjectOutputStream and the ObjectInputStream classes. With these, you should be able to send and receive the array with no problems. Follow the advice in the JavaDocs and possibly the Java Tutorial for more info on using the ObjectStreams.
    Regards,
    Manuel Amago.

  • For 2 weeks, I have been unable to use sync & it says that server maintenance is underway & will resume automatically; need to transfer history to a new laptop

    For about 2 weeks, I have been unable to use sync. I keep getting a message that says server maintenance is underway & will resume automatically. How long will this maintenance last? I urgently need to transfer my history to a new laptop and return the one I am currently. My deadline for this is tomorrow as I have run out of time to complete this process

    I have reset sync and the messages have stopped coming (I hope I have not messed things up). However, I still don't think sync is working (how do I confirm?).
    I don't recall all of the exact words of the error message but it was similar to this: sync operation failed server maintenance is underway and will resume automatically. To check server status (click on something). Each time I clicked on the button provided, I was directed to a mozilla page which informed me that most people are able to use firefox sync and that additional capacity was on the way.
    To confirm if rectification of the error had occurred, I tried getting sync on my other laptop to update and I got a similar error.
    Yes this has been going on everyday for 2 weeks. I have been given a new laptop where I work and was given some time to transfer all my files. The deadline expires today and am to return the old one tomorrow.
    Is there a way I can permanently reset sync to just take in my most recent history and passwords?
    Thanks for responding

  • Need to build communication redundancy using serial RS-232 for Data Transfer b/w Host and RT irrespective of TCP/IP Data Transfer

    Hi - I would like to build the logic in which it should accomodate the communication redundancy using serial RS-232 for Data Transfer b/w Host and RT irrespective of TCP/IP Data Transfer.
    I want to do data transfer b/w host and RT through RS232 VISA portal whenever TCP/IP ethernet cable has been unplugged from the controller continuosly , it should keep on checking for TCP/IP link re-establishing also , when ever the tcp/ip link established again that time the communication should be using in that link only. This is accomplished by deploying the RT vi as execuatbale file. I made some logic regards to the above said logic , bur it was not working as much I expected.
    I request you to go through the attached two VI's and let me know , what I did wrong in that,
    Please do the needful.
    Attachments:
    TCP_Serial_Host.vi ‏33 KB
    TCP_Serial_RT.vi ‏41 KB

    even i am new to this topic and i am trying to get familiar with these protocols
    refer to tcp server/client examples in labview examples

  • Error in Data Transfer Process (DTP) Urgent!

    Hi,
    ive encountered an error in uploading data from R3 using DTP in a specific cube and it says "Exceptions in Subset: Load and Generation" and "Dump: ABAP/4 processor: MESSAGE_TYPE_X", how can i fix this problem? is there any problem with the upgrade process of our system or in KERNEL? and what is KERNEL? Please help me guys.....
    Thanks,
    nips

    Please do not post the same question twice.
    Error in Data Transfer Process (DTP) Urgent!

  • HT1296 Help! I failed to back up the data on my iphone 4 16gb using iTunes Version 11.01. The error message read that the back up was corrupt. I am suppose to delete the back up. Can someone help me? I urgently need to back up the data!:\

    Hi guys!
    I really need help. I tried to back up the data on my iphone 4 on the iTunes version 11.01 but failed.
    The error message read : the backup was corrupt or not compatible with iPhone. can anyone advise me on this,
    as I urgently need to back up my phone in anticipation for my iPhone 5.
    Greatly appreciated!

    this usally happens when the backup you tool was from an old ios version. Two options that you can try is
    1.  Delete the back up by going to edit> preferences> devices & delete back up on itunes & try backing up again
    2.  Update the ios software of the iphone4 & then take a back up. then try restoring
    Taz

  • I need a data transfer from intact hard drive of older macbook that won't boot. Can Apple provide this service even though my one to one membership has expired?

    I need a data transfer from a 2005 Macbook to my new one (2010). I damaged the old laptop and although it wouldn't turn on, when I brought it to the Apple Store they ascertained that the hard drive was still intact. They said I needed to purchase a one to one membership to get a data transfer, which I did, but somehow forgot about it and now it's expired. Is there any way I can still get the data from the old hard drive transferred to my new macbook? Can Apple provide this service even though my one to one membership has expired?

    Go to OWC where you can purchase a suitable enclosure for the drive. You will need an enclosure for a SATA notebook drive. This is assuming the old computer is a MacBook and not an iBook. I make this observation because the first MacBook was released in 2006, not in 2005. If yours is a 2005 model then it's an iBook and uses an ATA interface.
    Install the old drive in the enclosure, connect to your new computer. You can then transfer your data.

  • What firewire cable do I need to transfer data from a 2010 macbook to 2014 macbook

    What firewire cable do I need to transfer data from a 2010 macbook to 2014 macbook

    You would need a Firewire 800-800 (9-pin) cable and a Thunderbolt to Firewire adaptor.
    Matt

  • What do I need to transfer data from my old MacBook Air to a new MacBook Air

    what do I need to transfer files and programs from my old MacBook Air using OSX Lion 10.7.5 to a new MacBook Air?

    An external USB drive on which you can install a clone of your old computer's drive. You csn then connect it to your new computer and use Migration Assistant to migrate your data to the new computer. Or you can manually select which of your files you want and copy them to the new computer.

  • What software do I need to transfer data from a pc to imac

    What software do I need to transfer all my data from a pc to my imac?

    Did  you install the Migration Assistant for Windows?
    http://support.apple.com/kb/DL1415
    Can you explain at what point it fails?
    Leave both computers plugged into the router - that's probably the safest network configuration.
    Matt

  • Error during data transfer from Lotus Notes to SAP via JCO - Urgent Help Required

    Dear SAP Expert:
    I need your help! Recently getting error during data transfer to SAP. I need your suggestion!
    I am transferring Lotus Notes data to SAP via JCO, recently getting the below error msg, could you pls tell me what could be the reason?
    Please suggest me how to fix that kind of issue.
    "com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Error in ABAP/4 statement when processing an internal table. table.
    at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
    at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)
    at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)
    at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)
    at SAPAdapter.execute(Unknown Source)
    at JavaAgent.fillBapiAndWriteBackToNotes(Unknown Source)
    at JavaAgent.NotesMain(Unknown Source)
    at lotus.domino.AgentBase.runNotes(Unknown Source)
    at lotus.domino.NotesThread.run(NotesThread.java:249)
    Thanks in advance! Your help would be highly appreciated! Thanks again!

    error is clear, check your abap code.

  • HT1766 i got a new iPhone. i need to transfer data from my previous to the new

    I got a new iPhone. I need to transfer all of my data from my old to the new. How do I do that?

    Read http://support.apple.com/kb/HT2109

  • Data transfer from MySQL to Oracle Urgent!

    Hi All,
    We have a table in MySQL database and we need to transfer a subset of its data over to Oracle table. The table in MySQL is big, so we created a temp table trying to do it several times. The question is, we set the the primary key column in both MySQL temp table and Oracle table ( a varchar column), when we transfered the data over using "insert into table_name select * from table_name@hsdobc", Oracle always gave the "Null value for not Null column" error, and it's only existed for one row no matter how many rows we want to transfer, but MySQL temp table has no such null value for the primary key column, it's very strange. Anyone knows what the problem might be? Thanks very much in advance.

    Hi, thanks for your answer. I checked the MySQL table again, and found that in both the original table and the temp table, there is a row with the primary key column value "null". Don't know what happened? Probably it's a MySQL bug.
    It's not Primary Key NULL value. If your new Oracle Table has ANY column defined
    NOT NULL and while inserting you have at least one value in one row of coming data is NULL - It will fail. You need either to drop NOT NULL constraint for that
    column(s), or provide value for it.
    Also you can drop that NOT NULL constraint, Insert your data as is,
    Update your data to get rid off all NULLs and put NOT NULL constraint back on.
    ALTER TABLE MY_NEW_TABLE MODIFY MY_NEW_COLUMN NULL;
    UPDATE MY_NEW_TABLE SET MY_NEW_COLUMN = 'Some_Value';
    ALTER TABLE MY_NEW_TABLE MODIFY MY_NEW_COLUMN NOT NULL;

  • Business Objects(BOs) & Data Transfer Objects(DTOs)-both needed ?

    In a J2EE system...
    I know that "Business Objects" (BOs) are basically value objects (VOs) ...lots of getters and setters and some business logic. These are basically to model nouns in the system. Eg Student BO.
    I know that "Data Transfer Objects" (DTOs) are value objects (VOs)....with getters and setters... with the purpose of avoiding multiple method calls...to avoid overhead...which effects performance. eg it's better to pass a Student DTO then say...pass the student ID and student name and student age etc etc.
    Main question : Should a system have both ? If yes, why do I need a StudentBO.java and then another StudentDTO.java....when they are so similar ?...when both are basically VOs ? Can't I just use BOs to serve as DTOs ?
    Thanks.

    Hi,
    I've started using BO's and DTO's since 3 months .With my experiece i understand we nned both of them.
    The BusinessObject represents the data client. It is the object that requires access to the data source to obtain and store data.
    DTO
    This represents a Transfer Object used as a data carrier. The DataAccessObject may use a Transfer Object to return data to the client. The DataAccessObject may also receive the data from the client in a Transfer Object to update the data in the data source.
    From this i want to tell you that We are not gonna do any operation on BO's but we do operations on DTO
    Ashwin

Maybe you are looking for

  • Invalid field in parameter list. (0x26, 0x00)

    I was archiving my old family videos and making a nice movie of them in final cut express. I exported them the same as I always do and created a menu using the reflections theme in iDVD. The movie was big so I adjusted the settings for DVD+R DL as I

  • Java web service: XML to SQL

    Background: I am a second year degree student currently on placement. The company I am with wants me to design a web service that listens for incoming XML data from an external system and uses this data to update a database. Does anyone have any tips

  • Libvirtd: setup questions and permission problems

    Hello, i noticed that someone removed the section which states that the "user=" and "group=" parameters of the /etc/libvirt/qemu.conf should modified from the libvirt wiki page. So i removed my qemu user and commented the "user=" and "group=" paramet

  • I can't open e-mail or otherwise get Hotmail to respond since installing 4.0

    I've gone to my Hotmail inbox and am unable to read e-mails. It will download new e-mails, but won't allow me to read anything. When I right click, I get none of the usual items such as "mark as read". Instead I get "back", "reload", etc. I need my e

  • SCCM 2012 yanger version

    Hi! I use SCCM 2012 ST (5.00.7958.1000). I installing two updates: 5.00.7958.1101 5.00.7958.1203 System Center 2012 Configuration Manager (ConfigMgr) 2012 2013/11/02 R2 KB2905002 5.00.7958.1101 Post R2 Hotfix: KB 2905002 (Client Version) Must have Sy