ArshadAQ
asked on
Invoking DB2 Stored Procedure using Java PreparedStatement
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.
Thanks much.
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.
Thanks much.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Comment from expert accepted as answer
Computer101
E-E Admin
Computer101
E-E Admin
I will leave a recommendation in the Cleanup topic area that this question is:
- points to asharma2
Please leave any comments here within the
next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
vemul
Cleanup Volunteer