Programming binary data in Java

A use case contains a series of yes/no options. In the web front end, they are in the form of checkboxes. For anyone with CS background, it is easy to think of a series of binary data which is an integer in Java. One advantage of this approach is that no change is needed for the application back-end DB table if those option entities are changed such as adding more options.
The data conversion is a problem with the approach, however, in Java. It is not too bad to convert a series of binary data to an integer:
          StringBuilder sb = new StringBuilder();
          sb.append(option1 ? "1" : "0");
          sb.append(option2 ? "1" : "0");
          Integer.valueOf(sb.toString());     I have some problems with a conversion from an integer to a series binary data:
       Integer.toBinaryString(anInteger)which doesn't preserve the number of digits if the significant digit is zero.
Any better way?

vwuvancouver wrote:
A use case contains a series of yes/no options. In the web front end, they are in the form of checkboxes. For anyone with CS background, it is easy to think of a series of binary data which is an integer in Java. One advantage of this approach is that no change is needed for the application back-end DB table if those option entities are changed such as adding more options.
For anyone with practical experience in databases and servers it is easy to think of that as likely being the wrong solution. ESPECIALLY if you anticipate more options might be needed.
Any better way?Depends on what you are actually doing.
But if and only if you want to manipulate bits then the easiest way is to use the bit operators that java has. And it would not require any conversions at all. I would like to think someone with a formal (education) background in computer science should have some idea of how to do that.

Similar Messages

  • How to store binary data in Java

    I need to show news in my web aplication.So I am retrieving news from a Feed Server in which the field GEN_UNICODE_MESSAGE_1 gives the news data.News consists of both English/Arabic data.So how will I store the binary content in JAVA and how can I display the news in JSP?
    I tried storing the binary content in ByteArrayInputStream and appended it using StringBuilder.But I didnt get the desired output.Output is seen as ÇáÎáíÌíÉ ááÇÓÊËãÇÑÇáãÌãæÚÉÇáÔÑßÉÇáÇãÓÈÊãÈÑÓÈÊãÈÑÅÌãÇá.Please help me.
    Here GEN_UNICODE_MESSAGE_1 is of type BINARY.
    try{
    BufferedInputStream in=new BufferedInputStream(new ByteArrayInputStream((byte[])msg.getField("GEN_UNICODE_MESSAGE_1").value.get(h)));
    //ByteArrayInputStream in=new ByteArrayInputStream(((byte[])msg.getField("GEN_UNICODE_MESSAGE_1").value.get(h)));
    StringBuilder builder = new StringBuilder();
    byte[] buff=new byte[1024];
    int len;
    while ((len=in.read(buff))!=-1){
    builder.append(new String(buff,0,len));
    String incomingmsg=builder.toString();
    }catch(IOException e){}
    Edited by: Alance on May 7, 2010 10:12 PM

    BufferedInputStream bis=new BufferedInputStream(new ByteArrayInputStream((byte[])msg.getField("GEN_UNICODE_MESSAGE_1").value().toString().getBytes()));
    BufferedReader br = new BufferedReader(new InputStreamReader(bis));What on earth is all this?
    1. What is the type of msg.getField("GEN_UNICODE_MESSAGE_1").value()?
    2. Whatever that type is, you are then converting it to a String.
    3. You are then converting that to bytes.
    4. You are then casting that to byte[], which it already is,
    5. You are then wrapping a ByteArrayInputStream around that.
    6. ... and an InputStreamReader round that ...
    7. ... and a BufferedReader around that ...
    8. ... and reading lines
    9. ... and appending them to a StringBuilder
    10. ... and converting that to a String.
    Which you already at at step 2.
    String incoming = msg.getField("GEN_UNICODE_MESSAGE_1").value().toString();Not sure whether that's correct given the charset issues, but if not the problem starts at step 2. In any case steps 3-10 add precisely nothing.
    This is all pointless. The key question is (1). Answer that first.
    2. The type of String.getButy
    >
    StringBuilder sb = new StringBuilder();
    String line = null;
    while ((line = br.readLine()) != null) {
    sb.append(line + "\n");
    br.close();
    String incomingmsg=sb.toString();

  • What to use to store binary data in Java

    Hello,
    I have to read data stored as varbinary in the SQL database. What kind of class, data type I can use to store binary data from database?
    I need to store binary data finally in ByteBuffer.
    Please, help.
    Thank you!

    Unfortunately, when I am doing following I am getting an exception:
    ByteBuffer lUTF8BIN=ByteBuffer.allocate(6)
    byte [] lTempByteArray lTempByteArray = Recordset.getBytes(VarBinColumn);
    if (lUTF8BIN.remaining()>=lTempByteArray.length)
    lUTF8BIN.put(lTempByteArray);
    Exception is java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported data conversion

  • Displaying image from binary data using java

    hi there,
    i have created a swing applet displays me a url, what the url returns me is the image in binary format, and i want to show the complete image using that binary data
    so how do i do it.
    some thing like this :
    URL url = new URL("http://192.168.1.1:8086/file-storage/download/Zerg.jpg?version_id=35688");
    JEditorPane jep = new JEditorPane();
    jep.setPage(url);
    output is in binary on my applet window.

    Hey,
    This displays an image from a url, you could check if your url is and image or not using URL.getFileName() and see if it ends in gif jpeg etc. and then display it this way.
    hope it helps
    Nick Hanlon
    import java.awt.*;
    import java.awt.Image.*;
    import java.awt.Toolkit.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.text.html.*;
    public class SimpleApp extends JFrame {
    public static void main(String args[]) {
    SimpleApp aFrame = new SimpleApp();
    public SimpleApp() {
    super("Frame");
    /*JEditorPane jep = new JEditorPane();
    jep.*/
    try {
    HTMLEditorKit htmlKit = new HTMLEditorKit();
    JEditorPane ep = new JEditorPane();
    try {
    ep.setEditorKit(htmlKit);
    BufferedReader in = new BufferedReader(
    new StringReader(
    "<HTML><IMG SRC=\"http://developer.java.sun.com/images/chiclet.row.gif\"></HTML>"));
    htmlKit.read(in, ep.getDocument(),0);
    getContentPane().setLayout(new BorderLayout());
    setResizable(false);
    getContentPane().add(ep, "North");
    pack();
    show();
    } catch (javax.swing.text.BadLocationException e) {}
    } catch (IOException e) {}
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) { System.exit(0); }
    }

  • Download file problem for binary data?

    Dear All,
    I have wrote a jsp file to do download page. I have used a piece of code from the JDC to this. This code will prompt the download dialog box each time user clicks the download button. The code itself will set the content type for different application. The code is like below:
    try
    java.io.File fileobj = new java.io.File(strFolder + strFile);
    response.setContentType(application.getMimeType(fileobj.getName()));
    response.setHeader("Content-Disposition","attachment; filename=\""
    + strFile + "\"");
    java.io.FileInputStream in = new java.io.FileInputStream(fileobj);
    int ch;
    while ((ch = in.read()) != -1) {
    out.write(ch);
    out.flush();
    in.close();
    } catch(Exception e)
    The code can download and handle text file correctly when it is openned in the text editor or inside the IE. But when a PDF file or Image is downloaded and openned in the PDF viewer or image viewer, it is corrupted and cannot be viewed. What is the problem? Any ideas?
    So, I wonder this code can handle binary data or not. It is seen like there is no different code to handle text and binary data in Java/Jsp.
    Thank you very much!
    Best Regards,
    Rockyu Lee
              

    Add following lines to .tld file (custom tag definition)
    <tag>
    <name>downloadbinary</name>
    <tagclass>org.rampally.DownloadBinaryTag</tagclass>
    <bodycontent>JSP</bodycontent>
    </tag>
    Add following line to JSP files.
    In JSP, keep one line of source. Make sure that there are no space and additional line feeds at the any where
    in the JSP files except JSP tags.
    <%@ taglib uri="/WEB-INF/taglibs/mb.tld" prefix="mytags" %>
    <mytags:downloadbinary />
    I am hoping that you have all required parameters such as fileName to download, etc.
    in your session or request object.
    Tag class ....
    public class DownloadBinaryTag extends TagSupport {
         public int doEndTag() throws JspException {
              // TODO: get binary data from filename or
              // binary data buffer from datase.
              // I am making it simple .. assume that it is a request parameter for
              // you test easily.
              String fileName = request.getParameter( "filename" );
              java.io.File file = new java.io.File( fileName);
              java.io.DataInputStream dis;
              try {
                   dis = new java.io.DataInputStream(new FileInputStream(fileName));
              } catch (FileNotFoundException e) {
                   // do error handling ...
                   return EVAL_PAGE;
              BinaryUtil.sendBinaryFile( dis, (HttpServletResponse) pageContext.getResponse(), contentType );
              return EVAL_PAGE;
    public class BinaryUtil
         static public void sendBinaryFile( DataInputStream dis,
                                  HttpServletResponse response,
                                  String contentType ) {
              try {
                   response.setContentType(contentType);
                   String fileName="test.pdf";
                   response.setHeader("Content-disposition", "inline; filename=" + newFileName );
                   ServletOutputStream sout = response.getOutputStream();
                   int len;
                   byte[] data = new byte[128 * 1024];
                   while ((len = dis.read(data, 0, 128 * 1024)) >= 0)
                        sout.write(data, 0, len);
                   sout.flush();
                   sout.close();
              } catch (Exception e) {
                   System.out.println(e.getMessage());
         static public void sendBinaryFile( byte[] data,
                                  HttpServletResponse response,
                                  String contentType ) {
              try {
                   response.setContentType(contentType);
                   String fileName="test.pdf";
                   response.setHeader("Content-disposition", "inline; filename=" + newFileName );
                   ServletOutputStream sout = response.getOutputStream();
                   sout.write(data);
                   sout.flush();
                   sout.close();
              } catch (Exception e) {
                   System.out.println(e.getMessage());
    You may have to change 'inline' to 'attachment' if you do not want IE to inline the document.
    That's all!!.. Hope this helps...!

  • How to Convert Binary Data in Binary File

    hi,
    my telecom client puts a binary file which is asn.1 encoded with BER.
    how to handle binary data in java.
    how to convert binary to hexa to ascii format
    how to convert binary to octet to ascii format
    please help me in this.
    regards,
    s.mohamed asif

    You don't need to convert the data.
    Only you can do is print it in that formats, like it:
    public static String byteArrayToHex(byte[] b) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < b.length; i++)
             sb.append(Integer.toHexString(b&255) + " ");
    return sb.toString();
    take a look at this
    http://java.sun.com/docs/books/tutorial/essential/io/

  • How to convert numeric data to binary decimal in java

    How to convert numeric data to binary decimal in java Pleas egive me code example

    There is no numeric data. It's all binary. If you're talking about Strings, look at the Integer class.

  • Some binary data recoreded by labview cannot open by other program

    I have got some binary data which is recorded by a labview program. When I use some other program to open it (e.g. matlab, notepad, MS excel), it become some strange character, but when I use another labview retrieval program to open it, there is no problem. What happen?
    The original data is 32 bit data sets which are separated by a <CRLF>.
    The recording program (HS-Acquis.llb), the retrieval program (Advanced Viewer.llb), original data file (C1010710.480245) and the data file after retrieval (C1010710.480245.txt) was attached
    phy_mechanic
    Attachments:
    attachment.zip ‏1279 KB

    The data seems like it can only be read by LabVIEW because LabVIEW is set up to properly read the binary data and it is simple for a user to do.
    For matlab to read the data, it will have to be properly configured.
    FOPEN     -     Open a file
    FREAD     -     Binary file read
    FWRITE   -     Binary file write
    FTELL      -     Return the current file position
    FSEEK     -     Set file position indicator
    FCLOSE   -     Close a file
    An example is given from http://www.mathworks.com/support/tech-notes/1400/1​403.htm:
    %This m-file is a short example of how to read and write a binary file
    %in MATLAB using low level routines
    %write file
    fid = fopen('square_mat.bin','wb') %open file in binary write mode
    fwrite(fid, 'This is a square matrix', 'char'); %insert a header
    fwrite(fid, [1 2 3; 4 5 6; 7 8 9]', 'int32'); %write data to file
    fclose(fid); %close file
    %read in the same file
    fid = fopen('square_mat.bin','rb') %open file
    bintitle = fread(fid, 23, 'char'); %read in the header
    title = char(bintitle')
    data = fread(fid, [3 inf], 'int32') %read in the data
    data_tranpose = data' %must transpose data after reading in
    fclose(fid) %close file
     As you can see, the data type, size, array size, etc. has to be explicitly defined. In addition, as Dennis alluded to, LabVIEW stores binary data in Big-Endian format, wheras most windows applications use little endian. I assume matlab is one of those applications...but I am not a huge matlab developer. Google may have more information on that. You can use a typecast in matlab to convert big to little and little to big, however, so that may be a great place to start. Please see http://www.mathworks.com/access/helpdesk/help/tech​doc/ref/typecast.html
    Of course, our wonderful applications engineers at National Instruments have already done the above work for you and developed Knowledgebase 11SF83W0: How do I Transfer Data Between The MathWorks, Inc. MATLAB® Software Developm...which is easily searchable from ni.com knowledgebase category using 'matlab binary'
    Rob K
    Measurements Mechanical Engineer (C-Series, USB X-Series)
    National Instruments
    CompactRIO Developers Guide
    CompactRIO Out of the Box Video

  • Help needed with binary data in xml (dtd,xml inside)

    I am using the java xml sql utility. I am trying to load some info into a table.
    my.dtd:
    <!ELEMENT ROWSET (ROW*)>
    <!ELEMENT ROW (ID,JPEGS?)>
    <!ELEMENT ID (#PCDATA)>
    <!ELEMENT DESCRIPTION EMPTY>
    <!ATTLIST DESCRIPTION file ENTITY #REQUIRED>
    <!NOTATION INFOFILE SYSTEM "Files with binary data inside">
    <!ENTITY file1 SYSTEM "abc.jpg" NDATA INFOFILE>
    xml file:
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE ROWSET SYSTEM "MY.DTD">
    <ROWSET>
    <ROW>
    <ID>1272</ID>
    <DESCRIPTION file="file1"/>
    </ROW>
    </ROWSET>
    I am using the insertXML method to do this. However, the only value that gets loaded is the ID. abc.jpg is in the same directory where I ran the java program.
    Thanks in advance.

    Sorry! wrong dtd. It should read this instead:
    my.dtd:
    <!ELEMENT ROWSET (ROW*)>
    <!ELEMENT ROW (ID,DESCRIPTION?)>
    <!ELEMENT ID (#PCDATA)>
    <!ELEMENT DESCRIPTION EMPTY>
    <!ATTLIST DESCRIPTION file ENTITY #REQUIRED>
    <!NOTATION INFOFILE SYSTEM "Files with binary data inside">
    <!ENTITY file1 SYSTEM "abc.jpg" NDATA INFOFILE>
    null

  • How can I transfer binary data from a database to another database?

    Hi all.
    I want to transfer binary data from a MS SQL Server 2000 to anohter SQL Server 2000.
    I created JDBC(table) to JDBC(stored procedure) scenario,and
    I uploaded a JPG image file to the sender table using the java program I developed.
    The JPG data was transfered to receiver,but the transfered data was broken.
    I can't not open the file correctly.
    Can XI transfer binary data using JDBC adapter?
    The sender table structure is following.
    <b>column (data type)</b>
      id  (int 4)
      binary (binary 8000)
      flag (int 4)
    The receiver stored procedure parameter is following.
    <b>parameter (data type)</b>
       id  (smallint)
      binary (binary 8000)
      flag (smallint)
    Regards.
    Yuuki

    Hi,
    <i>Can XI transfer binary data using JDBC adapter?</i>
    Ans: Yes
    Supported JDBC Types
    http://help.sap.com/saphelp_nw04s/helpdata/en/16/9dc9ac8bc72a48b80e639abaa2e497/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    Mapping JDBC types to Java types
    http://help.sap.com/saphelp_nw04/helpdata/en/7d/79dfa72d1049bc963f4f272bb1638e/frameset.htm
    Regards,
    Prateek

  • Binary Tree in Java - ******URGENT********

    HI,
    i want to represent a binary tree in java. is there any way of doing that.
    thanx
    sraphson

    HI,
    i want to represent a binary tree in java. is there
    e any way of doing that.
    thanx
    sraphsonFirst, what is a binary tree? Do you know how the binary tree looks like on puesdo code? How about a representation in terms of numbers? What is a tree? What is binary? The reason I ask is, what do you know about programming?
    Asking to represent a binary tree in java seems like a question who doesn't know how it looks like in the first please. Believe me, I am one of them. I am not at this level yet. If you are taking a class that is teaching binary trees and you don't know how it looks like, go back to your notes.
    Sounds harsh, but it is better to hear it from a person that doesn't know either then a boss that hired you because Computer Science was what you degree said. Yet, you don't know how to program?
    Telling you will not help you learn. I can show you tutorials of trees would be start on where to learn.
    HOW TO USE TREES (oops this is too simple, but it is a good example)
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
    CS312 Data Structures and Analysis of Algorithms
    (Here is a course about trees. Search and learn)
    http://www.calstatela.edu/faculty/jmiller6/cs312-winter2003/index.htm

  • Errors and exceptions in writing large binary data on sockets!!! urgent

    hi
    I am trying to write large binary data in the form of byte arrays on sockets.
    Data is as large as 512KB(== 524288bytes) So i store the data (actually read from a file through FileInputStream ) and then write on the socket with lines like this
    DataOutputStream dos =
    new DataOutputStream(new BufferedOutputStream(sock.getOutputStream()));
    dos.write(b);
    /* suppose b is the arrayreference in which data is stored. sometimes i write with that offset + len function*/
    dos.flush();
    dos.close();
    sock.close();
    but the program is not stable: sometimes the whole 512KB is read on other side and sometimes less usually 64KB.
    The program is unthreaded.
    There is another problem : one side(reading or writing) sometimes gives error :
    java.net.SocketException: Software caused connection abort: socket write error
    please reply and reply soon and give ur suggestions
    thanks

    hi
    I am trying to write large binary data in theform
    of byte arrays on sockets.
    Data is as large as 512KB(== 524288bytes) So istore
    the data (actually read from a file through
    FileInputStream ) and then write on the socketwith
    lines like this
    DataOutputStream dos =
    new DataOutputStream(new
    BufferedOutputStream(sock.getOutputStream()));
    dos.write(b);
    /* suppose b is the arrayreference in which datais
    stored. sometimes i write with that offset + len
    function*/
    dos.flush();
    dos.close();
    sock.close();
    but the program is not stable: sometimes the whole
    512KB is read on other side and sometimes less
    usually 64KB.
    The program is unthreaded.
    There is another problem : one side(reading or
    writing) sometimes gives error :
    java.net.SocketException: Software caused
    connection abort: socket write error
    please reply and reply soon and give ursuggestions
    thanksUmm how are you reading the data on the other side?
    some of your code snippet might help. Your writing
    code seems ok. I've written a file transfer program
    in a similar fashion and have successfully testing on
    different platforms (AIX, AS400, Solaris, Windows,
    etc) without any problems and without needing to set
    the buffer sizes with files as large as 600MB and you
    said you're testing this on the loopback?
    Point here is you should never need to reset any of the default TCP options to get program correctness. The options are more for optimizations and fine tuning. If indeed you need to change the options to get your program to work, then you program wont be able to scale under different load.

  • Writing binary data in same format as with FORTRAN code

    Hello,
    I would like to write out data in a binary format that is used by FORTRAN unformatted direct access files. I have some code in FORTAN that produces the correct format; however, I have been unable to reproduce the output with a Java method.
    The FORTAN code to write an array Z is:
    REAL Z(72,46,16)
    OPEN(8,FILE='grads.dat',FORM='UNFORMATTED',
    & ACCESS='DIRECT',RECL=72*46)
    IREC=1
    DO 10 I=1,16
    WRITE (8,REC=IREC) ((Z(J,K,I),J=1,72),K=1,46)
    IREC=IREC+1
    10 CONTINUE
    The Java code I was able to come up with to write out an array arrTS produces binary data differently:
              FileOutputStream fosOut = new FileOutputStream(filename,false);
              for(int x=0; x<this.xmax; x++) {
                   for(int y=0; y<this.ymax; y++) {
                        ByteArrayOutputStream bosOut = new ByteArrayOutputStream(2);
                        DataOutputStream dos = new DataOutputStream(bosOut);
                        dos.writeFloat((float)this.arrTS[x][y]);
                        byte[] arrByte = bosOut.toByteArray();
                        fosOut.write(arrByte);
              fosOut.close();
    Any help is greatly appreciated.
    Best regards,
    Stefan

    I am using a software to read in the data that I am calculating in Java. I cannot easily change the format that software is reading; therefore, ASCII is not an option.
    The software that reads the data states something about "Little-endian". Do you which Java classes to use for that?
    Best regards,
    Stefan
    First, you need to find out the format of yourFORTRAN
    output. Is it ASCII? EBCDIC? BCD? IEEE?
    Big-endian? Little-endian?
    Until you know that you won't know which Javaclasses
    to use.Also I wouldn't be too sure different FORTRAN
    compilers use the same data format.
    In my view the best system interchange format still is
    the ASCII text file. Why don't you let the Fortran
    program use it to write its data to file. It should be
    no problem reading it from Java.

  • How to append binary data to existing file in OSB

    Hi,
    I have an OSB project that I need for it to append binary data via ftp.  Here's my current flow:
    MFL binary output --> Replace $body with mfl binary output --> Publish to action (Business service that's configured to ftp binary data).
    However, when the data is ftp'ed the following error is thrown:
    URI = ftp://xxx:21/opt/home/zzz/logs
    Request metadata =
        <xml-fragment>
          <tran:headers xsi:type="ftp:FtpRequestHeaders" xmlns:ftp="http://www.bea.com/wli/sb/transports/ftp" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="h
    ttp://www.w3.org/2001/XMLSchema-instance">
            <ftp:fileName>11802_insert_oh_xfrmr.eai_data</ftp:fileName>
          </tran:headers>
          <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
          <ftp:isFilePath xmlns:ftp="http://www.bea.com/wli/sb/transports/ftp">false</ftp:isFilePath>
        </xml-fragment>
    Payload =
    19266787^CLLL^C711791^CLLL^C^C1178213^CSingle Phase(1)^C63185066204^CA^CConstructed^C358880 NW 4 DR LK MONTAZA^C120/240^C09361^CN/A^CProposed Remove^CAerial^C45718100^C
    Unknown^C^CNo^CNormal Closed^CClamp^CA^C1^C2-Cover^C19266796^CNo^CNo^C15^C^CYes^CYes^CYes^C13200Y/7620 X 22860Y/13200^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
    ^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C19266641^Coh_fuse_switch^C63086930001^C4^CN31^CDD0613^C22.9^C63376474601^C8129580^CFalse^C4^COke
    echobee^C43^C0^Cdefault^CYes^C
    >
    ####<Nov 6, 2013 2:28:23 PM EST> <Error> <WliSbTransports> <goxsd1604> <osb_server1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<
    anonymous>> <BEA1-4B688443B66FA09FFE75> <d2b4601b2fffd9b7:6b9f2297:1422a857ee8:-8000-000000000000171b> <1383766103889> <BEA-381105> <Error occured for the service endpo
    int: com.bea.wli.sb.transports.TransportException: Unable to open data connection. Message is Received error response (553) from FTP server [mpsd1] IP [10.111.19.32] po
    rt [21] status [connected] upon executing command [stor opt/home/zzz/logs/11802_insert_oh_xfrmr.eai_data.a]
    com.bea.wli.sb.transports.TransportException: Unable to open data connection. Message is Received error response (553) from FTP server [mpsd1] IP [10.111.19.32] port [2
    1] status [connected] upon executing command [stor opt/home/icanadm/logs/11802_insert_oh_xfrmr.eai_data.a]
            at com.bea.wli.sb.transports.ftp.connector.FTPTransportProvider.sendMessage(FTPTransportProvider.java:422)
    From what I understand the error code 553 represents a bad file name.  The file name that I'm supplying is 11802_insert_oh_xfrmr.eai_data but it appears that the name is changed to 11802_insert_oh_xfrmr.eai_data.a .  So I did the obvious and changed the file several different ways (without the .eai_data extension, removed the numbers from the file name) but still no luck. 
    Any suggestions?
    Thanks,
    Yusuf

    Thanks Eric.
    I'm using the JCA FTP adapter instead and noticed it's appending the test generated data supplied by the OSB test console.
    However, how can I ensure that the MFL output that I need to append will be placed on a new line? 
    Also, how should I map/assign the MFL binary output to the opaqueElement type base64Binary defined in the WSDL file below?
    Once again here's a sample payload that I need to ensure will be presented on a new line:
    19266787^CLLL^C711791^CLLL^C^C1178213^CSingle Phase(1)^C63185066204^CA^CConstructed^C358880 NW 4 DR LK MONTAZA^C120/240^C09361^CN/A^CProposed Remove^CAerial^C45718100^C
    Unknown^C^CNo^CNormal Closed^CClamp^CA^C1^C2-Cover^C19266796^CNo^CNo^C15^C^CYes^CYes^CYes^C13200Y/7620 X 22860Y/13200^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
    ^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C19266641^Coh_fuse_switch^C63086930001^C4^CN31^CDD0613^C22.9^C63376474601^C8129580^CFalse^C4^COke
    echobee^C43^C0^Cdefault^CYes
    Here's the WSDL file that gets generated for the FTP adapter:
    <wsdl:definitions
         name="PutGenericDevice"
         targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/ftp/AMS/Project1/PutGenericDevice"
         xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
         xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/ftp/AMS/Project1/PutGenericDevice"
         xmlns:opaque="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
         xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
        >
      <plt:partnerLinkType name="Put_plt" >
        <plt:role name="Put_role" >
          <plt:portType name="tns:Put_ptt" />
        </plt:role>
      </plt:partnerLinkType>
        <wsdl:types>
        <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
                xmlns="http://www.w3.org/2001/XMLSchema" >
          <element name="opaqueElement" type="base64Binary"/>
        </schema>
        </wsdl:types>
        <wsdl:message name="Put_msg">
            <wsdl:part name="opaque" element="opaque:opaqueElement"/>
        </wsdl:message>
        <wsdl:portType name="Put_ptt">
            <wsdl:operation name="Put">
                <wsdl:input message="tns:Put_msg"/>
            </wsdl:operation>
        </wsdl:portType>
    </wsdl:definitions>
    Here's the JCA details:
    <adapter-config name="PutGenericDevice" adapter="FTP Adapter" wsdlLocation="PutGenericDevice.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/ftp/DssPut"/>
      <endpoint-interaction portType="Put_ptt" operation="Put">
        <interaction-spec className="oracle.tip.adapter.ftp.outbound.FTPInteractionSpec">
          <property name="PhysicalDirectory" value="/opt/eai/ofmw/Oracle/Middleware_R7/logs"/>
          <property name="FileType" value="binary"/>
          <property name="Append" value="true"/>
          <property name="FileNamingConvention" value="dummy.txt"/>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>
    Thanks,
    Yusuf

  • Oracle 9.2.0.8 Binary Data Problem

    Hi Folks,
    need some advice from the experts here about an error I got yesterday while installing a (Java-based) Software at a customer using Oracle 9.2.0.8.
    While being able to work with the database most of the time, I get an error when trying to save binary data. Unfortunately I don't have access to the DB-logs, so I hope the log I have may raise a thought or two from anybody and that may help me bring some light into the darkness I'm poking in at the moment.
    <log>
    java.sql.SQLException: No more data to read from socket
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
         at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:962)
         at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:894)
         at oracle.jdbc.ttc7.Oclose.receive(Oclose.java:103)
         at oracle.jdbc.ttc7.TTC7Protocol.close(TTC7Protocol.java:693)
         at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:731)
         at oracle.jdbc.driver.OraclePreparedStatement.privateClose(OraclePreparedStatement.java:535)
         at oracle.jdbc.driver.OraclePreparedStatement.close(OraclePreparedStatement.java:440)
         at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.close(DelegatingStatement.java:168)
    </log>
    I searched around and got some results about
    - codepage: The DBA told me that the DB is using "cp1252", so I tried to use both ISO-8859-1 and UTF-8 (both are supported by the application)
    - Session Management: Tried to raise/decrease the limits for idle/maximum connections and the DBA told me to set the parameter "SESSION_CACHED_CURSORS=0", but unfortunately this is not possible when using a connection URL "jdbc:oracle:thin:@..."
    So... if anybody has an idea what to check or ask the DBA to change or almost anything, I'd kindly welcome the feedback.
    Thanks,
    enni

    Hi Sybrand,
    thank you for your clarification for the codepage!
    And no, I don't think that I found a new issue, just wasn't able to find a good answer on the net and after trying to get an evaluation copy (just for the install and first tests) of Oracle 9, the support told me "No way.".
    And yes, you're definitely right, it should be buried.
    But we all know that there are companies out there that allow new applications tests on thier "good'old" DB. Guess that is exactly what happens here.
    Maybe somebody else reads this and had similiar problems in the past, so I keep this "open" for just some more time.
    Thanks,
    have a good time!
    enni

Maybe you are looking for

  • Using setTimeout function in APEX

    Hi, I am trying to show a print dialog box after which I need to take confirmation from the user whether the printout has come fine or not. For acheving this I am trying to use setTimeout in javascript which is not working. The confirmation box is co

  • HT1750 How do i stop downloads from one Admin account from going onto the other one?

    So there are two admin accounts on my imac, and one day i logged into the other persons account, and all my downloads were showing up in their folder, how do i seperate the two, so that what i download on the mac from my account is only visible on my

  • SQL "View" with TS?

    Hello, is it possible to handel a SQL "View" with TestStand or the Database Viewer? I can see my tables but not the view. greetings schwede

  • Long Number being displayed when people receive Texts

    People who have been receiving texts are getting a long string of numbers, like 13 numbers?? what is this?? how can this issue be resolved?

  • Skype Premium with Unlimited Calls

    I have Skype Premium active but I can't find the country where I can get unlimited calls. Is there a way for this to be listed on Skype website or the Skype desktop client?