Sending Data Through a Output Stream...

Hello,
I am writing a program that works on a network...a server is running and client will connect to the server and send specific data for the server to complete transactions on.
The transactions that are mainly seen are SQL SELECT statements and as you can imagine a statement could bring back many records.
At present I have been able to send specific data through streams and have turned this into parameters on the server side and performed SQL. What I need help with or suggestions on is how to get the data back to the client. In some cases it may need to be displayed on screen or just used for further processing?
Please let me know if this is not 100% clear.
Thanks,
P

If you are able to send data over a network, then I assume that you know how to do network programming in Java, as well as knowing SQL.
Java has JDBC - Java DataBase Connectivity API that supports your requirements in full.
If you require a custom solution, then you need to be able to read data back from the server - when the server returns the ResultSet back to the client.
A Socket object has both input and output streams. Seems that you know about the output stream, do you not know about the input stream?
If the server is setup to send data back to the client over the same socket, then you should simply be able to read the results back from the socket's input stream.

Similar Messages

  • Exception writing binary data to the output stream to client -Broken pipe

    Hi,
    I am trying to use the drag & drop feature using Contributor mode of Webcenter sites. Single Image Page Attribute is working properly where as Multiple Image Page Attribute throws the following error:
    [ERROR] [.kernel.Default (self-tuning)'] [logging.cs.satellite.request] Exception writing binary data to the output stream to client 10.191.117.106
    java.net.SocketException: Broken pipe
         at java.net.SocketOutputStream.socketWrite0(Native Method)
         at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
         at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
         at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:568)
         at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:539)
         at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:427)
         at weblogic.servlet.internal.ChunkOutput$2.checkForFlush(ChunkOutput.java:648)
         at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:333)
         at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:148)
         at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:148)
         at COM.FutureTense.Servlet.ServletRequest$OutputOutputStream.write(ServletRequest.java:80)
         at COM.FutureTense.Servlet.ServletRequest.write(ServletRequest.java:1633)
         at com.openmarket.Satellite.RequestContext.write(RequestContext.java:1123)
         at com.openmarket.Satellite.BytePiece.stream(DataPiece.java:253)
         at com.openmarket.Satellite.CacheObjectImpl.stream(CacheObjectImpl.java:651)
         at com.openmarket.Satellite.Http11Responder.respondForWrapper(Http11Responder.java:142)
         at com.openmarket.Satellite.WrapperAwareResponder.respond(WrapperAwareResponder.java:36)
         at com.openmarket.Satellite.SatelliteServer.execute(SatelliteServer.java:85)
         at com.openmarket.Satellite.servlet.BaseServlet.doGet(BaseServlet.java:118)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.fatwire.wem.sso.cas.filter.CASFilter.doFilter(CASFilter.java:557)
         at com.fatwire.wem.sso.SSOFilter.doFilter(SSOFilter.java:51)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Thanks
    KarthiK

    Thank u very much,
         FileOutputStream opGif = new FileOutputStream(destFile, false);
    I have changed above line with the following line:
         PrintWriter opGif = new PrintWriter ( new FileWriter(destFile, false));
    and now this code is working very fine.
    Thanks once again...

  • Sender sending data through XML, How to process it in ECC (No PI involve)?

    Hi,
    The sender system sending data through XML tag and that need to be processed in SAP side.
    How it can be done without involving XI or IDoc?
    Is it possible through HTTP post?
    Sample XML Transactions
    1. SAP Availability Transaction (Request)
    <?xml version="1.0" standalone="yes"?>
    <ECCAVAILREQUEST>
    <AVAILTEXT>CHK STATUS</AVAILTEXT>
    </ECCAVAILREQUEST>
    2. SAP Availability Transaction (Response)
    <?xml version="1.0" standalone="yes"?>
    <ECCAVAILRESPONSE>
    <AVAILTEXT>OK</AVAILTEXT>
    </ECCAVAILRESPONSE>
    3. DUMMY_SYSTEM PO Transaction (Request)
    <?xml version="1.0" standalone="yes"?>
    <DUMMY_SYSTEM REQUEST>
    <CREATEPB>1</CREATEPB>
    <POORDERDATA>
    05607015156070151TORDAEHTWW05727500002D0979054+
    </POORDERDATA>
    4. DUMMY_SYSTEM Order/Inquiry Transaction (Response)
    <DUMMY_SYSTEM RESPONSE>
    <C_PO>99999</C_PO>
    <RETURNDATA>
    DAT&#13;&#10;
    </RETURNDATA>
    </DUMMY_SYSTEM RESPONSE>

    Hi,
    check this link
    http://help.sap.com/saphelp_nw04/helpdata/en/21/e9c97ceb1911d6b2ea00508b6b8a93/content.htm
    this is for processing inbound IDOc through XML-HTTP(Inbound) port
    like this there should be an option for reading files placed by HTTP_POST.
    in SICF transaction there should be a service to do that.
    defaulthost -> sap-> xi-> adapter_plain. i know you don't have XI in your landscape but this is the component which be responsble for receving messages over HTTP_POST.
    look for a program which can access messages from there.
    please check with your basis team
    Suresh

  • How to send data back to publishing stream

    Hi,
    Environment: ActionScript3.0, FMS, Flash Project created in Flash Develop
    How to send data back to publishing stream? I need to send data back to publishing stream.
    Using NetStream.send() we can send data to subscribers but is it possible to send data from subscriber back to publisher using any NetStream method.
    One other solution to this is remoteSharedObject, but if it is possible with NetStream class then let me know.
    Thanks

    There are a number of ways to extract data from CRM On Demand including:
    * Export - manual process, generate CSV file containing CRM On Demand data
    * List/Analytics - manual process, export the contents of a report of list to a CSV
    * Web Services - programmatic, develop an application that queries for data within CRMOD
    * Integration Events - programmatic, use workflow to trigger event creation and then poll for events to know when an operation occurs on a record (i.e. Insert of new Account record)
    As for getting that data into another system, that will depend on the system and the methods available for inserting data that it makes available.
    Hope this helps.
    Thanks,
    Sean

  • Problem in sending data through email in brodcasting

    HI All
    i am trying to send the data through email in the broadcasting. but as i execute the broadcasting the message comes
    "Online processing is not possible for user 1"
    further its is saying
    "You want to execute a broadcast setting online. Processing this setting requires switching to another user (for example, with the user-specific precalculation of Web templates for a user other than your user). This is only possible in background processing."
    but i dont know how to login as seperate user. as i have to send the data through my login and not someone else.
    Hope i am clear.
    Please help me on this its very urgent
    Thanks

    The solution to this problem is that:-
    1. this is not an error
    2. it gives the warning beacuse we cannot execute the broadcast setting at that moment (with different users in reciepient list) i.e. we have to schedule the broadcast settings.
    Thanks
    Prat

  • J2ME app.: To update Oracle table by sending data through mobile phone

    Hello all,
    I want to develop a mobile app to update the table of oracle database by sending the data through the SMS (Short Message Service). Means I'll send a sms through my cellphone containing some data and this data will be used to update the remote oracle database. How to do that?. Plz help.
    Thanx in advance.

    hi
    My problem is here I need to update the loginfo table with the file name, count of records, table name and datetime.
    For instance my dat file is XX.dat
    my database table name is Mytable
    Total record count is 10,00,000 records
    datetime as on this date
    the data in the XX.dat file I am using the controlfile (SQL*loader and dumping into the Mytable.Now my 10,00,000 records are dumped into the Mytable.
    This process information I want to store it in the loginfo table. For this I need the trigger
    CREATE OR REPLACE TRIGGER MYTRIGG
    AFTER INSERT ON MYTABLE
    Declare
    V_Count Number;
    Begin
    Select count(*) into V_Count from Mytable;
    Insert into Loginfo(TotalRecords,Date)
    Values(V_Count,Sysdate);
    end;
    This is the trigger I have used.But in my loginfo table instead of one value as 10,00,000 it is getting each record as row by row
    1
    4
    100
    1000
    10,00,000
    So I need only one value to be stored and at the same time my tablename and filename must also be stored.
    Kindly help me
    suroop

  • Sending data through a serial write box (vision processing)

    Hi there, I am fairly new to labview and vision assistant. I was wondering if I could get some assistance on a particular problem we are having with our project. The idea is that we will use a webcamera to analyze a continuous loop of images and identify shapes, then send the data through the serial port to a controller which uses the mint motion language. The problem we are having is we cant sind a way to send the data we are getting from particle analysis to the serial port. Is there any way we can do this? I would be eternally grateful for any kind of pointers!
    I will attach the write to box we are using right now as well as the program itself
    Attachments:
    bild.vi ‏104 KB
    SKRIV2BOX.VI ‏31 KB

    What you are searching for are the functions "Flatten To String" and "Unflatten from String".
    Attachments:
    FlattenToString - UnflattenFromString.vi ‏16 KB

  • Problems in Sending Data through JMS Bridge - WLS 10.3 to WLS 11g

    I have a scenario where I need to send data from a queue configured on WLS 10.3 to WLS 11g. I am using OSB on WLS 10.3.
    What I have done is
    1. Created a JMS Based BS in OSB which sends data to jms://localhost:7001/ConnFactoryJNDI/QueueJNDI
    2. Created a JMS Bridge on WLS 10.3
    3. Source Destination has been configured as the one mentioned above.
    4. Target Destination has been configured to a queue on WLS 11g.
    When i execute the JMS Based BS in OSB, data is being written to the Source Queue directly. I am not sure of the JMS Bridge functionality but I assume that once data is written to the Source Destination, that data will be automatically pushed on the target destination.
    I have configured a JDBC store for the target queue but I no table is created with the data sent from the source.
    M i missing something here?

    I think this question belongs to weblogic server, but as far as I know bridge should be created always at higher version. means, you should create bridge at 11g and try to pull/drop data from 10g. To check any errors in bridge, check the server log and make sure status of bridge is "forwarding messages"
    Regards,
    Anuj

  • Sending data through network takes forever

    hi fellow java developper
    i'm developping a program that hides files contents trough xml messages in order to exchange securily from a intranet to an extranet whitout having to use ftp and port 21. The problem is it takes over 22 seconds to send a 22k from the server and it takes about 85 seconds to receive it on the client side. this is driving me nuts because i know that delay is extremely high. IS there a way to optimized those to following methods so that the delay is reasonnably cut down
    thanks in advance
    here is my code to send and receive data,
    private BufferedInputStream inBuffer; // input buffer
    private BufferedOutputStream outBuffer; // output buffer
    * Method to send a String to the client
    * @param content is the string to send to client
    public void send(String message) throws IOException
    ByteArrayOutputStream streamOfBytes;
         DataOutputStream insStream_Out;
         streamOfBytes = new ByteArrayOutputStream(message.length());
    insStream_Out = new DataOutputStream(streamOfBytes);
         for (int i = 0; i < message.length(); i++)
              insStream_Out.write((byte)message.charAt(i));
         outBuffer.write(streamOfBytes.toByteArray(), 0,streamOfBytes.size());
         outBuffer.flush();
         * This method permit reception of string messages
         * @param a single character identifying the terminator to avoid receiving garbage
         * @return a string containing the message
         public String receive(char terminal) throws IOException
         char c;
         String message = "";
    long start = System.currentTimeMillis();
    int i = 0;
         while ((c = (char)inBuffer.read()) != terminal)
         message = message + String.valueOf(c);
    i++;
         long end = System.currentTimeMillis();
    System.out.println("temps requis recevoir:" + (end - start) +" ms nbboucle:"+i);
    return message ;
         }

    Hmmm.. there are a few optimization possibilities here, both with respect to creating bytes and retrieving text from bytes again. This is more close to the way java does it, and also the recommended way:// Push data out to a byte[] like this:
    String data; // initialized elsewhere
    ByteArrayOutputStream target = new ByteArrayOutputStream( data.length() );
    DataOutputStream stream = new DataOutputStream();
    stream.writeUTF( data );
    stream.flush();
    byte[] bytes = target.toByteArray();
    // Read data in from an InputStream like this:
    InputStream input; // initialized elsewhere
    DataInputStream stream = new DataInputStream( input );
    StringBuffer result = new StringBuffer();
    try
       // terminates with an EOFException
       // (ridicolous, but that is what the specification says...
       while( true )
          result.append( stream.readUTF() );
    catch( EOFException e )
    return result.toString();However, if your code works, the times you talk about is probably not connected to bad code (unless your XML is really really big) but more likely to network problems. Note that if your output string results in a byte array larger than 65535 bytes, a DataFormatException will be thrown from writeUTF (so the method fails). In that case, you will have to use OutputStreamWriter / InputStreamWriter and specify encoding to be e.g. UTF-8.
    Good luck!
    Daniel

  • How to send data through gprs from j2me application to desktop

    hi
    i wanna send some data to a server(where http://localhost:8080/ccp.html is running).i wanna catch this data and use it further.
    how to do it through query string/xml.

    Hi srini,
    it depends upon what is the receiver system.If you want to save the emails coming from SAP to Files ..then u will have to use File adapter in the receiver side...
    check these weblog.....
    Receiving Mail attachments using additional files of file adapter
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
    Regards
    Biplab
    Use a Good Subject Line, One Question Per Posting - Award Points

  • Single source sending data through multiple messages to a single reciever

    Hi all,
    I am trying to implement the below scenario:
    - I am reading from table1 in a database using a sender channel1. Based on data retrieved, I perform a JDBC lookup on table2 (in same d/b) using a reciever channel2 in an UDF of a message mapping1.
    - The data retreived from table2 is mapped to an intermediate format1. A mapping between the intermediate format and target message type1 is performed and message is sent to the recieving system using a reciever channel3.
    - Now, I need to map data retrieved from table2 to different target message types1,2,3.. based on some criteria and send it to the same reciever. I intend to use a different target message type and intermediate format for every kind of data obtained from table2 and a corresponding mapping.
    I plan to do this without using a BPM. Is it possible? If yes, then are the 3 communication channels sufficient to achieve this or do I need to have more communicatin channels?
    Any help would be appreciated.
    Thanks,
    Amit

    This is pretty straight forward...
    change your design as folllowing :
    1. as you have both table 1 and 2 in the same database , you can directly write a join query to pick data from both the tables . this can be specified in the sender jdbc adapter
    so your source data type would be like
    row..0..un
    +f1(field from table 1)
    +f2( field from table 2)
    +f3(field from table 2)
    2. now just create 3 seperate mappings
    mapping 1 = between source structure given above and target MT1
    mapping 2= b/w source struc given above and target MT2
    mapping 3 = b/w source struc given above and target MT3
    3. use 1 receiver determincation ...1 interface detemination where you keep on adding the message interfaces and interface mapings created above..
    4. use 3 receiver agreemetns

  • Sending defaultTableModel via object output stream

    Hello,
    The defaultTableModel is make me crazy!
    The problem is;
    I have one server and x client.
    When new client is connected to the server, server sends the new client list in defaultTableModel.
    But only the last client is receive the new list.
    All other clients defaultTableModel.getrowCount returns 0
    Here are the codes:
    http://www.adatoz.com/files/java/daServer.java
    http://www.adatoz.com/files/java/daClient.java
    http://www.adatoz.com/files/java/aaServerThread.java
    first run server :-)
    then clients..
    first client nick list is okay.
    but when the second client was come, first client list is zero..
    Thank you,

    When you send the DefaultTableModel, you have sent a copy. When you resend it send the refrence again, but not the values. Thus once you send a object in an ObjectStream sending it again will not update it.
    What you need to do is send a new Vector containing the new data.

  • How i can receive & send data through port? urgent

    port=9999
    data receive in 4 column
    name, price, high, low
    i want to receive this data & display this data in from & automatic refresh
    do u have any idea ?
    plz urgent reply

    IDS (Internet Developer Suite) is a RAD tool to create database application however that totally depend upon your requirement but if u feels limitation while working on Form IDS , u can switch to Jdeveloper an open source environment but still u have option create bean in Jdeveloper as per your need and bundled it with your Forms.
    I still suggest to discuss the problems which you are facing while invoking the bean in your form so that we can guide u better.
    Finally, neither move to latest version or change your development platform just for seek of fashion
    Hope it clears now!

  • Bpc 7.5 - not sending data on a specific application

    Hi I use SAP BPC 7.5 SP7 patch 1 with Microsoft Sql Server 2008.
    I moved my AppSet from a server 32bit to a server 64bit.
    On 32bit server everything works fine.
    On 64bit server (64bit configurations written in BPC installation guide applied + no error in Server Manager > DIagnostic): I can't send data on a specific application I have.
    On 64bit server: I precessed all dimensions and all applications and then I even optimize. Nothing change.
    I have to applications: A and B.
    On Application A I can send data correctly.
    On application B in my Input schedules when I send data: everything seems to work fine but afer data refresh on my sheet the value disappear and nothing is written into FactWB table. No error displayed.
    Those input scheules are the same I have and working on 32 bit server.
    No errors into Windows event viewer so... what can I check or do more? How can I fix it?
    Edited by: Francesco Andolfi on Feb 10, 2012 7:56 PM

    Hi Francesco,
    have you tried modify application on B?
    have tried if you can send data through a new simple input schedule?
    Kind regards
    Roberto
    Edited by: Roberto Vidotti on Feb 10, 2012 8:35 PM

  • Send data from R/3 to BW via XI

    Is there any advantage to send data through XI to BW from R/3, instead of the standard extraction methods provided by BW? I know how to post the data into BW from XI, just whether or not it is worth routing the delta data through XI, instead of the standard methods provided.
    Thanks,
    Chris

    Hey Simon,
    Thanks for the information. So if I get you right, data generated within the ERP system will still use the extractors as long as it does not need to go to any other systems, however, if the data is being sent to other external interfaces, as well as Bw, then I should push the data to XI and split the messages there. As for data coming into the ERP system through XI, just split these messages in XI and update both the ERP and BW systems at the same time. Please just affirm that I understood you correctly.
    I will give you some points for the response!
    Thanks,
    Chris

Maybe you are looking for

  • Mail app crashing on open

    As soon as i open mail the rainbow circle comes up and sits there, and i end up having to force quit. Whats Wrong?

  • Unable to read software component versions from System Landscape

    Dear all, I have an ECC system with ABAP and Java installed. I already configured so that SLDCheck, RFC destination configuration run successfully. PIAPPLUSER is not locked and can logon. However, when I import software component version in Integrati

  • PDF's opening as postscript files in safari

    Hi, with the latest update to Safari (6.1) linked PDF files do not open in either a page or tab in formatted disply form, but rather as postcript source code. I'm running OS X 10.8.5 and did not alter any settings in Safari. How can I get Safari to d

  • Invalid E drive

    i had itunes but my computer got a virus and i had to wipe the hard drive. now i'm trying to reinstall itunes but every time i do it goes through the whole process and at the very end is says it was unsuccessful because i have an invalid E drive. wha

  • Message "data was copied" on FB01 via substitution

    Dear gurus On FB01, when I insert "invoice ref." manually and change the "baseline date" manually, the message showed that "data was copied". This is what I want. However, when I insert "invoice ref." via substitution(GGB1), the message "data was cop