Calling AS400 Stored Procedure from Java using Spring
I need to call an AS400(DB400) stored procedure from my web application which is using Spring and Struts. Please help me with sample codes on how to do this.
Also I am having all my queries in a properties file, and accessing the Datasource which is configured in the applicationcontext.xml
Will I be able to use the same approach for the stored procedure call alos?
Thanks in Advance,
Use the JDBC StoredProcedure
Extend the following class:
The constructor should take your datasource.
STORED_PROCEDURE_NAME should be the name of the stored procedure on the AS400.
Within the constructor, declare your inputs and outputs of the stored procedure.
Create the stored procedure object, and call the execute operation that you have overwritten. Follow the steps in the URL provided above.
declareParameter(new SqlParameter(WHATEVER, Types.VARCHAR));
declareParameter(new SqlOutParameter(NEXTPARAM, Types.VARCHAR));