I am having a problem with Java Client for DB2 stored procedure. I am using PreparedStatement and setting data using setString() function. In some cases when I have large buffer size the data is getting misaligned on the mainframe side due to some binary/invalid chars getting appended before the string.
Following is the Stored Procedure I/O Structure:
Field Name DATA TYPE INPUT/OUTPUT SIZE
HDRCNTL VARCHAR INPUT 300
INORDERNO CHAR INPUT 9
INGENL CHAR INPUT 91
INDATA VARCHAR INPUT 29942
COMMAREA VARCHAR OUTPUT 400
I am using setString() to set all the input data elements. The data received on mainframe has 2 additional chars in the beginning of INDATA string. I tried using setBytes() also and that doesn't work either. I am looking for solution to avoid the 2 chars getting on mainframe DB2.