Datatype Problems between Java and COBOL

I am calling a COBOL stored procedure from a Java Servlet. The COBOL stored procedure needs compressed numeric values and Java sends it Integer values. I'm getting an error saying my parameters don't match up. I'm wondering if it's because COBOL needs a compressed value. Has anyone else dealt with this or a similar problem? Please HELP!!!!
Thanks so much.

I need to add more information...
I am using JDBC. I am passing in 4 parameters from my Java code: 2 shorts and 2 ints. In the COBOL parameter definition they are 2 SMALLINTs and 2 INTEGERs. In the COBOL stored proc the 2 SMALLINTs are S9(04) comp and the 2 INTEGERs are S9(09) Usage comp. Example values that I am passing in are:
(short) 2000
(short) 22
(int) 1749
(int) 164
The stored procedure is on a DB2 database. Hopefully this gives you a little more information to go on...
Thanks.

Similar Messages

  • JAVA and COBOL

    Friends is it possible to have interaction between java and Cobol.
    I mean I want to use JSP as front end and the entered data(by some user) should be passed as parameter to a COBOL program.Then the data is processed and the o/p from COBOL program should be passed to JSP .
    thanks.
    MS

    Help needed.
    thanks

  • Data conversion for communication between Java and C/C++ program

    The real problem, i guess, is about data type conversion between Java and C programs. For instance, and int is supposed to be 4 bytes in Java, and also in C/C++. But, as far as I know, the size of and int in C depends on the processors architecture, so if it were a 64 bit arch., size of and int, double, etc. in C, would change. The real scenario would be a communication between a 32 bit machine (Java) and a 64 bit machine (C/C++).
    First of all, is this assumption correct?
    If so,
    how is it possible to deal with this problem in Java?
    Is there any way to know 'type length' automatically? or
    would it be necessary to modify the Java program to work with a C program in 32-bit or 64-bit arch?
    thx in advance

    cotton.m wrote:
    Yes you should develop the C part of the protocol first and then build from there.
    See http://forum.java.sun.com/thread.jspa?threadID=5243547 for a previous discussion of this topic.
    I understand what you mean, also the topic you referenced. I will explain the situation a bit more. The protocol is already defined: (16 bits message size, 16 message id, 32 bit time, etc.); it is also defined in C (structures and so on). So it would be easy to write my Java code using the specified protocol in bytes, and C types wouldn't be necessary to be considered. But, let's say that the C code can't be modified, and I thought (and don't know yet if its correct), that size of C types CAN changed depending on architecture. So if size changes for C types (code is specified in short, int, etc, and not in bit format), it all would be a mess, if I don't implement something in my Java code.
    cotton.m wrote:
    I don't believe that 32 or 64 bit enters the equation here at all.Maybe 32 o 64 doesn't mind, but sparc or PC could take a point here. Communication would be between a sun solaris sparc and windows x86 PC. But if type size in C/C++ does not change, I wouldn't really have any problem then...
    The situation is not ideal, I know, but is what I have; and I think I could have problems if I run the C program in other machines; so I would have to try to solve it whithin my Java Program.
    I hope it is clear now what I need.
    thx
    Edited by: MGasa on Jan 16, 2008 1:51 AM

  • Communication between java and c++, help!

    i am c++ programmer and newly to java.
    now i am developping a client/server app. i use java transfers data (socket) between client and server, and use c++ to create user interfaces because c++ is easier for interfaces.
    my question is:
    in a single PC, java needs to tell c++ what info was read from socket and c++ needs to tell java what info will be written to socket.
    i want to use 2 files (read and write) as media between java and c++. that is: java writes data to a file and c++ reads from the file, and vice versa.
    i know it's not efficient. could you tell me better way to do?
    thanks in advance.

    thanks for reply.
    my problem is: socket is fare in java, not fare in c++
    (win/nt). could u use server in a non nt-server
    machine with c++?I'm not sure what you mean "fair". NT-Server is just a version of NT that Microsoft adds their server products to. Most of which you don't want to use because they are a security nightmare. I think what your asking is can you do the equivalent of Java's ServerSocket in C++. Sure, the socket libraries in Windows (at least last time I checked) were based off the BSD socket libraries. So you would basically do something like:
    // Open socket
    ss=socket(AF_INET, SOCK_STREAM, 0);
    if(ss==-1)
      cerr<<"Error opening socket."<<endl;
      return 0;
    // Fill in address
    struct sockaddr_in server;
    server.sin_family=AF_INET;
    server.sin_port=htons((unsigned short)port);
    server.sin_addr.s_addr=INADDR_ANY;
    // Bind to port
    if(bind(ss, (struct sockaddr *)&server, sizeof(server))==-1)
      cerr<<"Could not bind to port "<<port<<"."<<endl;
      return 0;
    // Ready to accept connections
    if(listen(ss, 5)==-1)
      cerr<<"Could not listen."<<endl;
      return 0;
    // Loop to accept connections
    while(/* some condition */)
      // Accept a connection
      int s=accept(ss, 0, 0);
    }This should work on any version of windows as long as you have winsock. The example code might need to be changed a little though since I copied it from a Linux program I had.

  • Problem with java and pogo games

    i use mozilla and now with the problems with java and hackers cannot play my pogo games,what can i do? i disabled my java i tried java 6 doesnt work or is not safe,what is a safe way to play games on pogo that use java?

    Oracle has released a Java 7 Update 11 to address security vulnerabilities and you should update to that version.
    *https://support.mozilla.org/kb/how-to-use-java-if-its-been-blocked
    See also:
    *http://kb.mozillazine.org/Java#Windows_installation_issues
    You can find the latest Java version on the Oracle website.
    See Java Platform > Java SE 7U11 and Java 6U38 (Download JRE)
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html

  • Why can't I use WebCT chat with my computer?  I get the 'spiral of death' every time I try to type in my chat.  I have a feeling it has to do with compatibility issues between Java and Tiger.

    Why can't I use WebCT chat with my computer?  I get the 'spiral of death' every time I try to type in my chat.  I have a feeling it has to do with compatibility issues between Java and Tiger.

    Hi Elizabeth,
    Do your Mac meet any of these requirements?
    http://www.wvnet.edu/services/webct/requirements.html
    From this it appears to be PC only!???
    http://sourceforge.net/projects/awebctcclient/files/Pancake%20%28it%20own%20proj ect%20now%29/Pancake%20Console%20V1.0.0/PancakeConsole-1.0.0-src.zip/download
    Can you provide any more info on which bersion or file you have?
    Can you tell us why you need this for your use?

  • Error while creating connection between Java and ABAP

    Experts
    I am getting the following error message when I am trying to test the connection between JAVA and ABAP systems.
    1. The system ID is valid
    2. The system was retrieved.
    3. The system object represents an SAP system
    4. The following parameters are valid: Web AS Protocol (http) Web AS Host Name (s09f71v06.svr.bankone.net:8100)
    5. The host name s09f71v06.svr.bankone.net was resolved successfully.
    6. The server s09f71v06.svr.bankone.net *could not be pinged* successfully.
    I have JAVA and ABAP on the same system. I am trying to establish a connection. I have checked all the settings and they looks fine. I have also pinged from other system to this server and the Ping works fine.
    Please do let m eknow where do I need to check for the errros or logs for the above error message.
    Appreciate your quick help.
    Mahesh

    Check the relevant services are test are active on the Backend system through SICF trransaction.
    Also make sure that default icm services are running.See note 517484.
    More important the connector test in the portal system should work properly,recheck the WAS path etc are correct.
    Regards
    Ajay

  • Do any of you experience Im having with my ipad? I can't make a comment in Facebook for older posts and I can't open numerous comments from old posts of my friends. but everything works perfectly when I use laptop. is there problem between apple and FB?

    do any of you experience Im having with my ipad? I can't make a comment in Facebook for older posts and I can't open numerous comments from old posts of my friends. but everything works perfectly when I use my laptop(non-apple). is there problem between apple and FB?

    Facebook apparently has their site coded poorly for tablets with touch screens. Try using the Facebook app. It is not perfect either but it is better than view in a browser lately.

  • Problems between PE4 and 10

    I have a drawing that was resized to a certain length using PE4. I have now upgraded to PE10 and when I print the drawing , it prints 3-4 times  larger than what it should be. When I view the drawing, the ruler at the top of the screen shows it being the correct length and when I checked the deminsion in the resize box, it also has the correct length. Have I done something wrong or should I delete the drawing and start over from scratch?

    Could you be a little more specific please? Sorry, I am not a tech guy just a poor laymen.
    Date: Thu, 2 Aug 2012 20:30:55 -0600
    From: [email protected]
    To: [email protected]
    Subject: Problems between PE4 and 10
        Re: Problems between PE4 and 10
        created by photodrawken in Photoshop Elements - View the full discussion
    Check your PSE print settings, especially the DPI value in the "Print Quality". Ken
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4595437#4595437
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4595437#4595437. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Photoshop Elements by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Do I need Java 8 or should i disable it? What happens if i disable it? And what is the difference between Java and Java Runtime?

    Do I need Java 8 or should I disable it? What happens if i disable it? And what is the difference between Java and Java Runtime?

    There's no difference. They're both runtime plug-ins (they run when an app calls for Java functions).
    You only need Java if you either have Java apps on your Mac that won't run without having it installed, or you use trusted web sites that require Java to function (getting fewer and far between). Otherwise, you have no need for it at all.

  • What's the difference between java and Javascript?

    I a new programer, I am getting Java down. Now I want to add some java scripts to my site. Is there any difference between java and Javascript? Can I use the Java API site refference and classes? Thanks..

    Java is a programming language, Javascript is more for web pages. It is used to add interactivity to your web pages. 2 different languages.
    check out www.java.sun.com for Sun Java stuff.
    Lynn

  • Difference in event handling between Java and Java API

    could anyone list the differences between Java and java-API in event handling??
    thanks,
    cheers,
    Hiru

    the event handling mechanisms in java language
    features and API (java Application Programming
    Features)features .no library can work without a
    language and no language has event handling built in.
    I am trying to compare and contrast the event
    handling mechanisms in the language and library
    combinations such as java/ java API.
    all contributions are welcome!
    thanks
    cheersSorry, I'm still not getting it. I know what Java is, and I know what I think of when I hear API. (Application Programming Interface.) The API is the aggregation of all the classes and methods you can call in Java. If we agree on that, then the event handling mechanisms in Java and its API are one and the same.
    So what do you want to know?
    %

  • ESS/MSS sso configure between java and abap instance

    Dear Gurus,
    I want to configure sso between java and abap instance for ESS/MSS. I couldnt find any guide for it, could you please help me gurus ?
    Other question is, is there any specific role for ESS/MSS users in JAVA instance. I want to create users and assign this role to them.
    Best Regards

    Hi Kemal,
    Hope you are doing good.
    There should be a / in the ITS path before SAP.
    Basically the entry that you have mentioned here should be accessible via browser as well. For eg in your case:
    http://<its hist name>/sap/bc/gui/sap/its/webgui should be accessible over browser.
    I also think you have put in a extra space in "w  ebgui". It should be "webgui".
    If the connector settings are working, then we can be sure that system connection is fine. You do not need to configure ITS settings.
    Also for SSO, refer the SAP note:1083421 and configure the SS0 settings again.
    Please run the SSO2 wizard and then make the automatic connection to
    the abap server. This will solve any inconsistencies on the server
    due to manual interventions.
    Most likely reason for the error is that certificates were loaded
    manually rather than using SSO wizard.
    More help:
    <http://wiki.sdn.sap.com/wiki/display/EP/Troubleshooting+SSO+between+AS-ABAP+and+AS-JAVA>
    The SSO enabling parameters should be set on the R/3 server.
    SSO Logon Ticket-> login/accept_sso2_ticket and login/create_sso2_ticket
    More info:
    <http://help.sap.com/saphelp_nw04/Helpdata/EN/22/41c43ac23cef2fe10000000a114084/frameset.htm>
    Thank you and have a nice day :).
    Kind Regards,
    Hemanth
    SAP AGS

  • How can I fix a problem between Firefox and my printer? When I try to print a window appears Save as ,then another saying Firefox not responding and printing does not work

    I used to be able to print correctly using Firefox as my browser,but something changed in the last month or so,possibly after a Firefox update. I`m not really sure how it happened but there seems to be a problem between Firefox and my printer. So I have been using Internet Explorer as my default so I can print. I would prefer to use Firefox again since that is where my bookmarks are. Is there a way to get the connection between Firefox and my printer back?

    '''Save as''' = sounds like you don't have your printer selected, or you have ''Print to file'' selected
    http://kb.mozillazine.org/Problems_printing_web_pages

  • Discussion Forum Portlet - Problems with JAVA and UTF8?

    Hi
    I installed the Discussion Forum Portlet successfully. It also seems that almost everything works fine. There's only a problem if I have new posts that include special German characters (Umlaute) like ä, ö, ü or special French characters like é, è or ç. They are saved correctly in the table but if you view the post the characters are not displayed correctly.
    Example
    input: ça va?
    result: ça va?
    I know that there are problems with Java and UTF8 Database. Is there a possibility to change this (bug)?
    Regards
    Mark

    Here's what I got. I don't see anything that helps but I'm kinda new to using SQL and java together.
    D:\javatemp\viddb>java videodb
    Problem with SQL java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver
    ] Syntax error in CREATE TABLE statement.
    Driver Error Number-3551
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in
    CREATE TABLE statement.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
    at videodb.main(videodb.java:31)
    D:\javatemp\viddb>

Maybe you are looking for

  • How can I convert RGB Color to Black-White Color?

    Dear everyone! I am using Photoshop CS5. I have got a file from my customer which is done as RGB and the resolution is 300dpi. There are black texts and color images in the file. I wish to print Black-White Process Film (1 black color), but I don't k

  • Oracle 10g on SuSE 9 with kernel 2.6.4

    Hi, i have installed Oracle 10g on SuSE 9 Professional with kernel 2.4.21-192 and it works fine. For testing purposes i have installed a 2.6.4 Kernel and get the following error on database startup: SQL> Connected to an idle instance SQL> ORA-27125:

  • Lock box : Program - odd situation.

    SAP  Friends,     I  need to understand the lockbox process in details: I have done the configuration steps of lockbox. The bank sent me a BAI format file which I ran by using program 'RFEBLB00'. it said difference in too large too clear. When I get

  • Importing/Exporting - I am no man of international business - Blerg

    When I import photos from my camera (Canon Power Shot S5) into iPhoto they automatically turn to .jpegs. This is no problem when I view them on the Mac, however, they remain such when I export them to a flash drive. When I take the flash drive to the

  • Calculating the percentages

    Hi Experts, Im working on BI7, i have a scenario in which i have to do some calculations. I have ODS and a realtime Infocube, from ODS we are getting one KF and from RT Infocube we are getting 3 kfs and 3 more KF's have to be calulated based on the C