Sending a text file Client/Server problem

Hi,
I have two java classes (A.java and B.java). i would like to send the text file (something.txt) from A to B. Can somebody please show me how to do so? I know it is incomplete, but i really need help since im new to this. I dont know how to send and how to accept the file. Here is what i have so far:
import java.net.*;
import java.io.*;
import java.lang.*;
public class A {
        private static String hostname;                  //host name
        private static final int portA = 1111;           //source port number
        private static int portB;                        //destination port number
        private static ServerSocket s;
        private static Socket socket;
        private static BufferedReader br;    
        String fileName = "something.txt";
        public A () {
        public static void send() {
                System.out.println("Send method");
                try {
                    System.out.print("> Enter Hostname: ");
                 hostname = br.readLine();
                 System.out.print("> Enter Port Number: ");
                    portB = Integer.valueOf(br.readLine()).intValue();
            catch(IOException e){}
        public static void main(String args[]) throws IOException {
import java.net.*;
import java.io.*;
import java.lang.*;
public class B {
        private static String hostname;                  //host name
        private static final int portB = 2222;           //source port number
        private static ServerSocket s;
        private static Socket socket;
        private static BufferedReader br;    
        public B () {
        public static void recieve() {
             //code to recieve the text file here?
        public static void main(String args[]) throws IOException {
}I really appriciate any code to help me out. Thanks

Check out the link shown below:
http://forum.java.sun.com/thread.jsp?forum=33&thread=66616
If that doesn't answer your question, search this site for Upload
;o)
V.V.

Similar Messages

  • Sending EMail "Text-File" from Application Server!

    Hi Experts,
    how can I sending a Text-File from Application Server via Email?
    Is there existing a Function Modul?
    With Kind regards
    Ersin
    Moderator message: sending emails = FAQ, please search before posting.
    Edited by: Thomas Zloch on Nov 25, 2010 4:23 PM

    STF (Search the forum)!  This type of question has been asked...and answered....many times.

  • Strange behaviour sending a text file over sockets

    Hi !
    Im not exactly new to Java. I discovered this behaviour when explaining to a junior.
    I have a simple Server-Client architecture to send a text file. The server sends strings to client. The client checks for the string to become null, and never terminates !
    Server.java
    ServerSocket ss = new ServerSocket(25780);
    Socket s = ss.accept();
    PrintStream ps = new PrintStream(s.getOutputStream());
    BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
    BufferedReader fis = new BufferedReader(
                   new InputStreamReader(
                        new FileInputStream(filename)));
    while((read = fis.readLine()) != null){
         ps.println(read);
    client.java
    Socket s = new Socket(IP,port);
    PrintStream ps = new PrintStream(s.getOutputStream());
    BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
    String read = new String();_
    *while((read = br.readLine())  != null){*_
    System.out.println(read);_
    Can you tell me what mistake I'm making?

    Thank you so much for the reply !
    All blocks are within try-catch. I didn't post the whole code since you would find it inconvenient !
    I tried flushing the stream ! Still doesnt work !
    I guess it might help to post the entire source:
    CLIENT.JAVA
        public static void main(String[] args) {
         try{
             System.out.println("Client");
             int port  = 25780;
             String IP = new String("127.0.0.1");
             Socket s = new Socket(IP,port);
             PrintStream ps = new PrintStream(s.getOutputStream());
             BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
             String command = new String();
             String filename_to_recv = "from_ser.txt";
             command = "GET "+filename_to_recv;
             ps.println(command);
             String received = new String();
             String read;
             while((read = br.readLine()) != null){
              System.out.println(read);
             String filename_to_send = "from_cli.txt";
             System.out.println("recd data from server");
             command = "PUT "+filename_to_send;
             ps.println(command);
             BufferedReader filereader = new BufferedReader(
                                 new InputStreamReader(
                                  new FileInputStream(filename_to_send)));
             String to_send = new String();
             while((to_send = filereader.readLine()) != null){
              ps.println(to_send);
             try{
               Thread.sleep(2000);
             } catch(Exception e){
              System.out.println(""+e);
              e.printStackTrace();
         } catch(Exception e){
             System.out.println(""+e);
             e.printStackTrace();
    SERVER.JAVA
       public static void main(String[] args) {
         try{
             System.out.println("Server");
             ServerSocket ss = new ServerSocket(25780);
             Socket s = ss.accept();
             PrintStream ps = new PrintStream(s.getOutputStream());
             BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
             String command = br.readLine();
             String filename = command.substring(command.indexOf(' ')+1);
             File f = new File(filename);
             BufferedReader fis = new BufferedReader(
                            new InputStreamReader(
                             new FileInputStream(filename)));
             String read;
             while((read = fis.readLine()) != null){
              ps.println(read);
             ps.flush();
             System.out.println("waiting for client data");
             command = br.readLine();
             while((read = br.readLine())  != null){
              System.out.println(read);
         } catch(Exception e){
             System.out.println(""+e);
             e.printStackTrace();
        }

  • How to send a text file to a printer?

    Hi, I'm in dark on how to send a text file to a printer through Java Stored Procedure.
    Here are what I tried so far (OS: win 2000, Oracle: 817 or 9i2):
    1, Enable DOS command in Java Stored Proc. and try to send PRINT command there:
    public static String Run(String Command){
    try{
    Runtime.getRuntime().exec(Command);
    System.out.println("Command: " + Command);
    return("0");
    catch (Exception e){
    System.out.println("Error running command: " + Command +
    "\n" + e.getMessage());
    return(e.getMessage());
    public static void main(String args[]){
    if (args.length == 1)
    Run("print /D:\\\\enterprise\\john " + args[0]);
    else System.out.println("Usage: java OSCommand filename");
    PL/SQL wrapper:
    CREATE OR REPLACE FUNCTION OSCommand_Run(p1 IN VARCHAR2) RETURN VARCHAR2 AUTHID CURRENT_USER AS LANGUAGE JAVA NAME 'OSCommand.Run(java.lang.String) return java.lang.String';
    SQL command:
    //print /D:\\machine\printer test.txt
    I loaded the Java Stored Procedure into SYSDBS account, it failed silently, even though piece of code works fine in external JVM.
    2, Use filePrinter:
    public static String print(String printString) {
    try{
    String printerUNC = "\\\\machine\\printer";
    FileWriter fw = new FileWriter(printerUNC);
    PrintWriter pw = new PrintWriter(fw);
    pw.println(printString);
    fw.close();
    return "OK";
    }catch(Exception e){
    e.printStackTrace();
    return "Exception: " + e.getMessage();
    public static void main(String[] args) {
    try{
    String printerUNC = "\\\\machine\\printer";
    String printString = "Hello World";
    FileWriter fw = new FileWriter(printerUNC);
    PrintWriter pw = new PrintWriter(fw);
    pw.println(printString);
    fw.close();
    }catch(Exception e){e.printStackTrace();}
    I loaded it into SYSDBS too, and tried with this:
    SQL> select MY_PRINT.PRINT('HELLO from Oracle') from dual;
    MY_PRINT.PRINT('HELLOFROMORACLE')
    Exception: No such file or directory
    SQL> show user
    USER is "SYS"
    It works in external JVM too.
    What's wrong with this?
    Thanks for any help in advance,
    Charles

    Avi:
    Thanks for your response!
    I put the java code in SYS, 'cause I assume that account has max privilege. If the test is successful, I will move that to some user schema and then to deal with those privilege settings... But I'm unlucky.
    I checked Ask Tom, this is what I got from http://asktom.oracle.com/pls/ask/f?p=4950:8:1619723::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:38012348052,%7Bprinter%7D:
    ... Print file from PL/SQL ...
    If you are using Oracle8i, release 8.1 -- much can be done with Java. java
    would be able to print directly from the server.
    Looks like using Java to print out file is better than PL/SQL. But there's no more hint there! And, no new question can be asked there today either...
    I'm wondering whether we can create a socket to a printer and send the characters there directly... Anyone has experience on this?
    Thanks for all the help in advance,
    Charles

  • Is SAP capable of sending a TEXT file in different modes like DOS ?

    Is SAP capable of sending a TEXT file (.txt)  in different modes like DOS ?

    Yes SAP is capable to send .txt file in different mode.
    For this you have to maintain the setting of Code page and encoding. There so may types of encoding (UTF-8, UTF-8 without BOM, UTF-16 etc) supported by SAP. You can check them from SAP logon pad.
    If you are creating the file on application server then you can also mentioned encoding statement in OPEN DATASET statements.
    For more details check open dataset statement.

  • How to send a text file over a LAN?

    Hi:
    I am working on a program (web app using a servlet), that produces a text file with Key / Value pairs ex) NAME
    joe
    CITY
    los angeles
    I want to send the text file over an intranet (LAN) to another pc and store it in the C:\temp directory of the receiving computer.
    Is it best to use the Networking package? Any idea on tutorials or code samples to help assist me? (I posted on Servlet Technology forum; nobody answered though...thanks for any thoughts.

    one way cud be that u write a program to open a port on the computer u want to store and make that program save on the required directory. then u can send a simple file in byte format over it. but doing this only wud b unsafe as others wud also hav the access. wat u cud do to prevent is to put some kind of password so that first u authenticate to server b4 u pass on the file.
    bye
    jods

  • Problen when Sending the text file as attachment to the external mail

    HI,
    I am sending the text file as an attachment to a aexternal mai. mailing is going with text file attachment, but text file is empty. No information in the file is going, only empty text file is going. I am sending the code  iam using. Please suggest, if I need to change any passing parameters orany other other solution.
    tables: knb1,kna1,adr6,ITEMSET,bsid,TSP01.
               INTERNAL TABLES
    DATA: BEGIN OF it_kna1 occurs 0,
            KUNNR LIKE KNA1-KUNNR,
            ADRNR LIKE KNA1-ADRNR,
          END OF it_kna1.
    DATA: BEGIN OF it_email occurs 0,
            ADDRNUMBER LIKE ADR6-ADDRNUMBER,
            SMTP_ADDR LIKE ADR6-SMTP_ADDR,
          END OF it_email.
    DATA: BEGIN OF it_bsid occurs 0,
           KUNNR LIKE BSID-KUNNR,
           BUKRS LIKE BSID-BUKRS,
         END OF it_bsid.
    DATA: BEGIN OF it_final occurs 0,
            KUNNR LIKE KNA1-KUNNR,
            ADRNR LIKE ADR6-ADDRNUMBER,
            EMAIL LIKE ADR6-SMTP_ADDR,
          END OF it_final.
    DATA: BEGIN OF BUFFER OCCURS 10000,
              TEXT(255) TYPE C,
            END OF BUFFER.
    data:xtext type solix_tab." occurs 0 with header line."line.
    data:xi_pdf type soli_tab.
    DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2  WITH HEADER LINE,
          OBJHEAD LIKE SOLISTI1   OCCURS 1  WITH HEADER LINE,
          OBJBIN  LIKE SOLISTI1   OCCURS 0  WITH HEADER LINE,
          OBJTXT  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE,
          RECLIST LIKE SOMLRECI1  OCCURS 5  WITH HEADER LINE,
          DOC_CHNG  LIKE SODOCCHGI1,
         PARAMS   LIKE PRI_PARAMS,
         ARPARAMS LIKE ARC_PARAMS,
         DAYS(1)  TYPE N VALUE 8,
         COUNT(3) TYPE N VALUE 1,
         VALID    TYPE C,
         RECEIVER(30),
         STR(256).
    data:  spoolid    type tsp01-rqident,
           pdf_table like tline occurs 0 with header line,
           v_bytecount type i,
           itab_pdf like tline occurs 10 with header line,
          xi_pdf  like tline occurs 0 with header line,
          xi_pdf  like buffer occurs 0 with header line,
           xi_pdf_1 like xi_pdf,
           v_length(2) type p,
           html  like solisti1   occurs 0  with header line,
           xi_temp      like bapiqcmime occurs 0 with header line,
           xi_mime(255) type c occurs 0 with header line.
              VARIABLES
    data: g_email type adr6-smtp_addr,
          TAB_LINES LIKE SY-TABIX,
          G_FLAG(1) TYPE C.
         g_norm(1) TYPE C,
         g_shbv(1) TYPE C,
         g_merk(1) TYPE C,
         g_park(1) TYPE C,
         g_apar(1) TYPE C.
    data: l_lines     type i,
          line1       type i,
          l_temp(500) type c,
          l_offset    type p,
          l_lineslen(2) type p,
          l_mimelen(2)  type p,
          v_spono like tsp01-rqident,
          l_tabix       like sy-tabix.
    *****VIA SELECTION-SCREEN
    ENDFORM.                    " SEND_TO_SPOOL
    *&      Form  GET_SPOOL_ID
    *&      Form  CONVERT_SPOOL_TO_PDF
    *&      Form  SEND_MAIL
    FORM SEND_MAIL .
      data:l_lin  like sy-tabix,
            l_lint like sy-tabix,
            it_list like abaplist occurs 0,
            l_newline(2) type x value '0D0A'.
    *--Data for the status output after sending
      data: user_address like sousradri1 occurs 1 with header line,
            sent_to_all like sonv-flag.
      clear: reclist, reclist[],
             objtxt , objtxt[],
             objpack, objpack[],
             objbin , objbin[],
             doc_chng.
    *--move list to office table objbin
    *--Start of Changes to support PDF attachments - UB20030116
    loop at html.
       objbin-line = html-line.
       append objbin.
       clear objbin.
    endloop.
    loop at xi_pdf.
       objbin-line = xi_pdf-text.
       append objbin.
       clear objbin.
    endloop.
    *--We may write additional text to the main document
    *--For faxing this will be the cover page. Like sending from SAPoffice
    *--the layout set Office-Telefax will be used.
      objtxt-line = 'NOTE : Please Consider the below Headers'.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Assignment -->  Purchase order number '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Document  -->   Invoice No '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Amount In DC --> Amount Due '.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Please find attached statement for this week'.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'This is an AUTO GENERATED MAIL'.
      concatenate objtxt-line 'Please Do not reply to this mail' into
      objtxt-line separated by ' '.
      append objtxt.
      clear objtxt.
      describe table objtxt lines tab_lines.
      read table objtxt index tab_lines.
    *--Create the document which is to be sent
    doc_chng-obj_name  = 'List'.
      doc_chng-obj_name = 'SAPRPT'.
    doc_chng-obj_descr = 'Customer statement for the week'.
      concatenate 'Customer statement for '
                  sy-datum into
                  doc_chng-obj_descr
                  separated by ' '.
      doc_chng-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
    *--Fill the fields of the packing_list for the main document:
    *--It is a text document
      clear objpack-transf_bin.
    *--The document needs no header (head_num = 0)
      objpack-head_start = 1.
      objpack-head_num = 0.
    *--but it has a body
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
    *--of type RAW
      objpack-doc_type = 'RAW'.
      append objpack.
    *--Create the attachment (the list itself)
      describe table objbin lines tab_lines.
    *--Fill the fields of the packing_list for the attachment:
    *--It is binary document
    objpack-transf_bin = 'X'.
    *--we need no header
      objpack-head_start = 1.
      objpack-head_num = 0.
    *--but a body
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
    *--of type G_DOC_TYPE
    objpack-doc_type = 'PDF'. "commented on 12/13/2007
      objpack-doc_type = 'TXT'. "commented on 12/13/2007
      objpack-obj_name = 'Attachment'.
    objpack-obj_descr = 'Customer Statement'.
      concatenate 'Customer Statement' sy-datum into objpack-obj_descr.
      objpack-doc_size = tab_lines * 255.
      append objpack.
      reclist-receiver = g_email.
      reclist-rec_type = 'U'.
    reclist-com_type = 'FAX'.
      append reclist.
      data:xi type soli.
    xi-line = 'haisdgsfsdf'.
    append xi to xi_pdf.
    xi-line = 'haisdfdsfd'.
    append xi to xi_pdf.
    xi-line = 'haisfgsdfsd'.
    append xi to xi_pdf.
    xi-line = 'haisdfsgfsdgg'.
    append xi to xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
        EXPORTING
          ip_solitab        = xi_pdf[]
       IMPORTING
         EP_SOLIXTAB       = xtext[].
    **--Send the document by calling the SAPoffice API1 module for sending
    **--documents with attachments
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = doc_chng
          PUT_IN_OUTBOX              = 'X'
         COMMIT_WORK                = 'X'
        IMPORTING
          sent_to_all                = sent_to_all
        TABLES
          packing_list               = objpack
          object_header              = objhead
         contents_bin               = objbin
          contents_txt               = objtxt
          contents_hex               = xtext
          receivers                  = reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          others                     = 99.

    HI,
    There are lots of bugs.
    Please refer this sample program to fix it.
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Best regards,
    Prashant

  • Sending a text file

    hi
    please can any one tell me if I want to send a text file residing on my mobile to another mobile using SMS how is it possible
    I already hv a j2me application tht can send a text message.
    I want a program tht will send this whole .txt file and the other end receives it as a text file
    thanx
    forumm

    hi
    can I split a text file and reassemble it using j2me
    or I send the text in the file using the usual sms
    and if I need to split the text file please can u give me some reference where I can find information about how to do that
    thanx a ton
    Forum

  • Need to send the text file using webservice

    Hi,
    I want to send the text file with contains data through oracle pl/sql using webservice. How can i handle this program?
    Kindly share with your details.
    Thanks in advance,
    Maran

    user8732035 wrote:
    I want to send the text file with contains data through oracle pl/sql using webservice. How can i handle this program?Web services supply XML structured data. Not text files.
    PL/SQL supports web services (XML output) and web procedures (text and binary output).
    You need to clarify your requirements.

  • How to send a text file as jsp response

    Hi
    I want to send a text file/or other file as jsp response ..How to do it..
    Pls tell me if any body knows about it..
    thanks

    Hmmm im no expert but i think you would have to convert it to a byte array and use OutputStream with the response ... not sure ...like i said, im no expert

  • Opening a text file in server from an applet running in the client

    Friends,
    I want to open a text file in the server(The server machine uses tomcat 4.1.12 server)from an applet running in the client machine;
    The applet invokes a servlet that opens the text file;this text file is opened in the server machine; but I want it to be opened in the client machine where the applet is running.
    Plese help me to get around this.

    You can open the textfile on the servlet and then send the information to the client (applet) as stirngs. The must then applet convert the stirngs into some object or simply display the information in someway. But then the text file that you are opening must be stored in some relevant tomcat directory e.g. on the server. If you want to open a file on the clients computer, you get into signed applets.

  • Error while sending a text file to client as attachment

    I want to download a file on clicking a button. Here is my button code
    <input type="button" onClick="showdownloadwindow()" value="Download My file">
    The java script showdownloadwindow() should invoke a jsp that has code to construct the text file to be downloaded
    Here is the javascript function
    <script>
         function showdownloadwindow()
              var url = 'http://<%=request.getServerName()%>'+':'+<%=request.getServerPort()%>+'/downloadtextfile.jsp';     
              window.open(url,"","");
    </script>
    the downloadtextfile.jsp looks something like this
    <%
              response.setContentType("text/plain");
              response.setHeader("Content-disposition","attachment; filename=myfile.txt" );
              BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream());
              String temp="Put some text string for now";
              bos.write(temp.getBytes());
              bos.flush();
              bos.close();
              response.flushBuffer();
    %>
    i have two problems
    1. when the button "Download My file" is clicked a separate window is opened and then the save file dialog box appears. How can I change my code
    so that it only shows download window only ( not another browser window)
    2. myfile.txt contains some error in addition to the temp string
    Here is the error from myfile.txt
    <BR><H3>Original Exception: </H3>
    <B>Error Message: </B>SRVE0199E: OutputStream already obtained<BR>
    <B>Error Code: </B>500<BR>
    <B>Target Servlet: </B>/downloadtextfile.jsp<BR>
    <B>Error Stack: </B><BR>
    java.lang.IllegalStateException: SRVE0199E: OutputStream already obtained
    <BR>    
         at com.ibm.ws.webcontainer.srt.SRTServletResponse.getWriter&#40;SRTServletResponse.java:467&#41;
    <BR>    
         at org.apache.jasper.runtime.JspWriterImpl.initOut&#40;JspWriterImpl.java:170&#41;
    <BR>    
         at org.apache.jasper.runtime.JspWriterImpl.flushBuffer&#40;JspWriterImpl.java:163&#41;
    <BR>    
         at org.apache.jasper.runtime.PageContextImpl.release&#40;PageContextImpl.java:217&#41;
    <BR>    
         at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext&#40;JspFactoryImpl.java:149&#41;
    <BR>    
         at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext&#40;JspFactoryImpl.java:117&#41;
    <BR>    
         at com.ibm._jsp._downloadtextfile._jspService&#40;_downloadtextfile.java:93&#41;
    <BR>    
         at com.ibm.ws.jsp.runtime.HttpJspBase.service&#40;HttpJspBase.java:88&#41;
    <BR>    

    > Channel FILE_TLE_Sender_SalesOrder_CC: Empty document found - proceed without sending message.
    > Can someone tell me why this error is happening? 
    Maybe your source file is empty?
    This is exact what the error message says.

  • Scenario or adapter to sending a text file to different target directories

    Hi experts
    In XI 3.0 I have developed a file2file scenario that takes a comma-separated file (*.csv) and converts it and returns a text file that is sent to a specific directory, the name input file determines the Target Directory, for each input file there is a sender channel and receiver channel that put the output file in the Target Directory. The problem is that i have many channels and not know how to make only one sender channel which takes the input file and the receiver channel to sends the output file to the destination directory through the file name. e.g. VTAS03.csv file located in target directory //work becomes in Clients.txt file in the directory //sap03 ie //work/VTAS03.csv --> //sap03/Clients.txt while the file VTAS05.csv must go to the directory //sap05 i.e. //work/VTAS05.csv --> //sap05/Clients.txt, //work/VTAS07.csv --> //sap07/Clients.txt so on.
    In short the output file name is the same for all but must go to different directories according to the input file name without using as many channels of communication.
    Someone can help me or tell me how to do this?
    Thanks  

    Liz,
    Please use the below steps if you are considering of using mapping program.
    Select the check boxes for the following Adapter Specific Message attributes in
    Sender Channel - FILE
    Receiver Channel - DIRECTORY
    Put the file name as Clients.txt in receiver channel , and directory name can be anything like TEST
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/File",
        "Directory");
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/File",
        "FileName");
    String temp = conf.get(key1);
    String src_filname = temp.substring(4,5) //This is used to get the last two digit value from the file name
    String tar_dir = "//sap"+src_filename+"/";
    conf.put(key,tar_dir);
    return "";
    I hope the above suggestion solves your problem!
    Thanks!

  • Socket I/O : mismatching object/text between client/server

    Suppose I'm listening on a socket for an object ...and I'm doing a ObjectInputStream.readObject() on it, but my client just opens an OutputStream and sends me text instead of an object (or vice-versa: Client sends object but server listens for text)? Is there a way of trapping such an error gracefully?

    I'm not sure what error checking you think you need to do.
    You will receive what was sent. TCP/IP guarantees that, and if it fails, you'll get an exception. I'm sure ejp can clear up my slop here. :-)
    Once one application has received what the other has sent, it's up to it to validate it however appropriate. It doesn't matter if it's a String or an Object graph. If it's a String, you'll have to make sure it's in a valid format for whatever your protocol is. If it's an Object graph, you'll have to make sure that all the fields have valid values. The two tasks are essentially equivalent. Which one is easier comes down to what you're sending, and the complexity the protocol and its validation rules, which are ultimately driven by your business requirements.

  • SENDING EMAIL USING ORACLE9i CLIENT/SERVER

    I HAVE DOWNLOADED 2 UTILITY LIBRARIES D2KCOMN and D2KWUTIL TO MY COMPUTER. THESE 2 LIBRARIES ARE COPIED TO AN ORACLE FORM. ON THE FORM, THERS IS A BUTTON. IN THE WHEN-BUTTON-PRESSED-TRIGGER, I HAVE CODED
    WIN_API_SHELL.WINEXEC('"C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\OUTLOOK.EXE"-c IPM.Note/m"'||:email.recipient_name||'&cc='||
    :email.recipient_name2||'&subject='||:email.subject||
    '&body='||:email.mes||'"',WIN_API.SW_SHOWNORMAL,TRUE);
    :email.recipient_name,
    :email.recipient_nam2,
    :email.subject, and
    :email.mess
    ARE FIELDS ON THE ORACLE FORM.
    THE NAMES ARE DEFINED BY THE PROGRAMMER.
    THE NAMES OF THE FIELDS ARE NOT RESERVED WORDS.
    WHEN THE CODE IS EXECUTED, MICROSOFT OUTLOOK IS OPENED AND THE RECIPIENT LINE, COURTESY COPY LINE, SUBJECT LINE
    AND BODY OF A NEW MESSAGE ARE PREPOPUTATED WITH THESE FIELDS FROM AN ORACLE FORM.
    THIS ROUTINE WORKS FINE ON AN ORACLE6i CLIENT SERVER BUT IT WILL NOT WORK WELL ON AN ORACLE9i CLIENT SERVER.
    WHAT DO I NEED TO DO TO CHANGE MY CODE? DO I NEED TO USE NEW UTILITY LIBRARIES? I WOULD SURE LIKE TO KNOW WHAT TO DO.

    Oracle9i Forms does not support client server - so you are running in a different environment (even though you may still only be onl two tiers).
    Regards
    Grant Ronald
    Forms Product Management

Maybe you are looking for

  • Display Payment Terms in MIRO and FB60

    FI Gurus, How can I restrict A/P clerks to only view payment terms when entering an invoice thru FB60 or MIRO. Thank You for your help,

  • Cost center to production order

    hi friends i have material cost on a cost centere A, i want to allocate thru assessment cycle from cost center to production orders. when i enter production order nummbers in ksu1 in allocation cycle as receiver, system give an error that it is "No v

  • IPhoto won't print

    This issue began a more major problem in which all of my wife's pictures disappeared. That's been solved, and the pictures are back. In order to keep that thread from becoming too long and complicated I'm reposting in this new thread the original pro

  • 4:3 displays

    This is not a really final cut pro related question, but since people here are so techically savy, I will ask anyway. Does anyone know of any 4:3 monitors which are good for video editing? The smaller the better. The reason is that I make most of my

  • Problem controlling jsf bean instantiation

    Hello folks, I am working on a project and I hit a hefty road block. I am pretty locked in with the overall process, so I won't be able to change the details of how this is supposed to work. I will explain my assignment, and how I am trying to implem