To call db2 stored procedure having parameters in java application

Hi,
I've created db2 stored procedure which is running perfectly on db2 server after giving a CALL to it. But when I tried to call this same stored procedure in java application, its reflecting with following error......
com.ibm.db2.jcc.b.SqlException: [jcc][10100][10910][3.50.152] java.sql.CallableStatement.executeQuery() was called but no result set was returned.
Use java.sql.CallableStatement.executeUpdate() for non-queries. ERRORCODE=-4476, SQLSTATE=null
at com.ibm.db2.jcc.b.wc.a(wc.java:55)
at com.ibm.db2.jcc.b.wc.a(wc.java:102)
at com.ibm.db2.jcc.b.tk.b(tk.java:575)
at com.ibm.db2.jcc.b.vk.yb(vk.java:136)
at com.ibm.db2.jcc.b.vk.executeQuery(vk.java:114)
at SPApplication.main(SPApplication.java:31)
Here is the code.......
import java.sql.*; public class SPApplication { public static Connection con; public static CallableStatement proc_stmt; public static ResultSet rs; /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try { Class.forName("DB2 DRIVER CLASS"); System.out.println("Class loaded....."); con = DriverManager.getConnection("jdbc:db2://localhost:PORTNO/" +                                   " DatabaseName", "username", "password"); System.out.println("Connection established....."); proc_stmt = con.prepareCall("call procedure_name(?)"); //IN Parameter proc_stmt.setInt(1, 5); System.out.println("Called procedure....."); rs = proc_stmt.executeQuery(); /******** THIS IS LINE NO. 31 *********/ while (rs.next()) {                              // Fetching rows one by one over here } proc_stmt.close(); rs.close(); con.close(); } catch (ClassNotFoundException cnfe) { cnfe.printStackTrace(); } catch (SQLException sqle) { sqle.printStackTrace(); } finally { /* try { proc_stmt.close(); rs.close(); con.close(); } catch (SQLException sqle) { sqle.printStackTrace(); } */ } } }
Please correct me, if I am wrong at any point in my application..
I would really appreciate for resolving my problem.
Thanks,
Manasi N.

Hi jschell ,
Firstly, I tried out with execute() and getMoreResults() to check if the statement is returning result set. - Its returning "null" only.
Secondly, I tried with following one by one :
1. Find a new jdbc driver
2. Write a different stored procedure.I am using DB2 Express edition - DB2 v9.7.0.0
I have the required jar files - i)db2jcc.jar ii) db2jcc_license_cu.jar
From these I found the available jdbc drivers as -
i) com.ibm.db2.jcc.DB2Driver
ii) COM.ibm.db2os390.sqlj.jdbc.DB2SQLJDriver
iii) com.ibm.db2.jcc.uw.DB2StoredProcDriver
I tried out my code by using each of these drivers, but still returning result set as null.
Moreover, I changed my stored procedure which has cursor returning result set. In this case also, result set is null.
Code snippet for this SP is -
30             Class.forName("com.ibm.db2.jcc.uw.DB2StoredProcDriver");
31             System.out.println("Class loaded....");
32             con = DriverManager.getConnection
33                 ("jdbc:db2://localhost:portno/dbName", "user", "password");
34             System.out.println("Connection established....");
35
36             proc_stmt = con.prepareCall("call javaSP()");
37            
38             System.out.println("Called stored procedure....");
39            
40             proc_stmt.execute();
41             //proc_stmt.executeUpdate();
42             //rs = proc_stmt.getResultSet();
43
44             System.out.println("Query executed....");
45            
46             if ((proc_stmt.getMoreResults() == false) &&
47                     (proc_stmt.getUpdateCount() == -1)) {
48                 System.out.println("No more result sets");
49             }o/p is (for every mentioned above jdbc driver) :-
Class loaded....
Connection established....
Called stored procedure....
Query executed....
No more result sets..
The o/p is always "No more result sets"
What else can be tried out to retrieve the result set from stored procedure from Java application? And the most important, these same stored procedures are returning result sets on db2 server after calling them.
Thank you,
Manasi.N
Edited by: Manasi.N on Apr 14, 2010 12:27 AM
Edited by: Manasi.N on Apr 14, 2010 12:28 AM

Similar Messages

  • Calling DB2 Stored procedure(with parameters) from powershell

    Hi 
    I am trying to call a DB2 stored procedure that has parameters from Powershell scrip and I am not able to can some one help me here?
    $ServerName = 'XXXX'
    $dbalias='XXXXX'
     $conn_string = "Provider=IBMDADB2;DBALIAS=$dbalias;Uid=;Pwd=;"
     $conn = new-Object system.data.Oledb.OleDbconnection
     $conn.ConnectionString = $conn_string
     $conn.open()
     $query="CALL DBID_CONTROL.GET_TABLE_MAINT_CTL(?,?,?,'MSAS','DATABASE_CONNECTIONS_CUBE','CUBE_PARTITION');"
     $cmd = new-Object system.data.Oledb.OleDbcommand($query,$conn)
      $ds=New-Object system.Data.DataSet
     $da=New-Object System.Data.OleDb.OleDbDataAdapter($cmd)
      $da.Fill($ds) [int]$cur_utc_date_key = $ds.Tables[0].Rows[0][0]
     $cur_utc_date          = $ds.Tables[0].Rows[0][1]
     ###list current date key & current date values
     write-output "current date key value is $cur_utc_date_key"
     write-output "current date value is $cur_utc_date"
     write-output " "
    Thanks

    Hi 
    This is the error message i get when i run the script
    Exception calling "Fill" with "1" argument(s): " CLI0100E  Wrong number of parameters. SQLSTATE=07001"
    At line:45 char:10
    +  $da.Fill <<<< ($ds)
        + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : DotNetMethodException

  • T-sql 2008 r2 place results from calling a stored procedure with parameters into a temp table

    I would like to know if the following sql can be used to obtain specific columns from calling a stored procedure with parameters:
    /* Create TempTable */
    CREATE TABLE #tempTable
    (MyDate SMALLDATETIME,
    IntValue INT)
    GO
    /* Run SP and Insert Value in TempTable */
    INSERT INTO #tempTable
    (MyDate,
    IntValue)
    EXEC TestSP @parm1, @parm2
    If the above does not work or there is a better way to accomplish this goal, please let me know how to change the sql?

    declare @result varchar(100), @dSQL nvarchar(MAX)
    set @dSQL = 'exec @res = TestSP '''+@parm1+''','' '''+@parm2+' '' '
    print @dSQL
      EXECUTE sp_executesql @dSQL, N'@res varchar(100) OUTPUT', @res = @result OUTPUT
    select @result
    A complicated way of saying
    EXEC @ret = TestSP @parm1, @parm2
    SELECT @ret
    And not only compliacated, it introduces a window for SQL injection.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Calling db2 stored procedures from wls 8.1 sp2

    Hi,
    We noticed strange behaviour when moving customers applications from wls 6.1 to 8.1 sp2. We have a use case where we call db2 stored procedure two times (same prcedure) to make inserts to a database. The first time when procedure is called, everything goes smoothly but at the second time db2 claims that statement is not prepared and gives us sql error sql0518n.
    We do see this error only if we use wls prepared statement cache and without cache (size=0) everything seems to work. We also did some db2 level tracing and noticed that statement is not prepared when using wls cache and db2 cannot execute statement which is not prepared....
    Why I'm asking this? because this is the first time I had disable wls cache. We have used it and even optimized software performance using prepared statement cache in several projects before this.
    Procedure call is done from web container lavel and no EJBs is used. We have tested the use case using autommit option and also committed firts transaction manually and closed connection.
    We are using DB2 8.2 fp7 as a database and IBM level 2 JDBC driver without XA support. Honor global transactions support is on at a datasource.
    Is this normal behaviour? Db2 problem or maybe WLS problem?
    Regards,
    Mika

    I am getting the same exception about an assertion failed at weblogic.t3.srvr.T3Srvr.checkServerLock. Any ideas?

  • Calling DB2 Stored Procedures

    Hi,
    Following is my question.
    From Forte, How to call to a DB2 stored procedure which acceptsparameters?.
    If anybody knows the answer please mail me to [email protected]
    Thank U in Advance
    Ram

    You might want to look into the documentation for the Oracle Transparent Gateway product for DB2. That should let you link to DB2 data from your Oracle database & stored procedures.
    Justin Cave

  • Calling mysql stored procedure having insert sql commands within cftransaction is not getting rolled back

    Hi,
    cftransaction is working perfectly when all the insert
    updates are called by cfqquery.
    But when there is a mysql stored procedure call with in
    cftrnsaction and that mysql stored procedure is having many inserts
    and updates, cftransaction is not able to roll back insert/updates
    happened in stored procedure.
    I am using InnoDB tables/database of mysql.
    Did anybody faced a similar problem and is it a coldfusion
    bug or mysql bug.
    We checked with Java and java is able to roll back the
    transaction, but coldfusion cftransaction is failing.
    Please help.
    Regards,
    Saikumar

    Mark,
    I believe the syntax of your formatted search is not right. I guess you are trying to get the U_Width from Item Master and the other values from the current form.
    SELECT @Width = T0.U_WTH FROM [dbo].[OITM] T0.WHERE T0.ItemCode = $[$38.1.0]
    EXEC TBC_CHOP @Width, $[$38.U_LINETYPE.0], $[$38.U_LI.0], $[$38.U_LN.0],
    $[$38.U_LD.0], $[$38.U_HI.0], $[$38.U_HN.0], $[$38.U_HD.0], $[$38.U_QTYORD.Number]
    If you see I have added a third parameter which is the Type to the formatted seach field selection $[$Item.Column.Type]
    I have made then all 0 but you may change it as per the col type.  This Type should be 0 for Char type columns, Number for numeric columns and Date for Date type cols
    Suda

  • CallableStatement - Calling a Stored Procedure having Null parameters

    Hi,
    Could anyone please let me know how I could call a PL/SQL procedure or a function from a JDBC
    method using CallableStatement? The procedure has 4 IN parameters - Param1,
    Param2, Param3, and Param4. Values are available for Param1 and Param2. Param3
    and Param4 have NULL values. Param3 has a SQL datatype of NUMBER and Param4 has
    a SQL datatype of Varchar2.
    We are using JDBC 2.0.
    Thanks.

    Problem solved :
    ArrayDescriptor + oracle.sql.ARRAY + String[] objects corresponding to the Oracle TABLE object.
    There are many examples on the web, but I just didn't manage to make them work before posting.

  • Call Oracle Stored Procedure with Parameters from Windows Batch File

    Hi,
    I have an oracle procedure that requires two parameters to execute, start date and end date as such:
    CREATE OR REPLACE PROCEDURE insert_orders(
    pSTART_DT IN varchar2
    , pEND_DT IN varchar2
    I want to create a windows batch file to execute the procedure but want to be able to specify the parameters (ie start and end dates) in the batch file as opposed to changing the sql file that the batch file uses to execute the procedure but I don't know what the syntax is. I tried the following but it still doesn't work.
    Sql File: call_insert_orders.sql
    execute insert_orders('&1','&2');
    exit
    Batch File:
    sqlplus username/password @call_insert_orders.sql %01-jan-2010% %01-jan-2011%
    When I execute the batch file, my DOS window still prompts me to enter value 1 so I think it recognizes that there is a variable being used but is not able to fill in the actual value I specify. I'm not an experienced DOS/Windows Batch File person so I'm guessing it's my syntax that's screwed up. There is not a lot of documentation on this subject matter hence my post on this forum. Any helps would be appreciated.
    Thanks

    Hello,
    Just try the same DOS command without all the % sign.
    In MS-DOS, the % at the beginning and at the end of a string are for variables. Which means your batch is looking for a variable called 01-jan-2010 and a variable called 01-jan-2011, but those are the values you want to pass, not the name of variables.
    As they are not defined, nothing is passed to the sqlplus script, and that is why you are prompted for values.
    Hope it will help.
    Regards,
    Sylvie

  • Calling Stored procedure with Parameters in PowerPivot DataModel

    Hi All,
    I wanted to call a SQL stored procedure from PowerPivot(Excel) on based on changing slicer's value. 
    Currently, we can call stored procedure wihtout any parameter from Data Model tab using 
    Exec stored_proc_name in Table Properties window.
    What if I want to call the same procedure with a parameter whouse value will come by changing slicer's value. I  meant, changing slicer value will act as a parameter to that stored procedure & it should return updated results. 
    Is this possible in PowerPivot?

    Hi Rameshwar,
    According to your description, you call a SQL Server stored procedure in PowerPivot data model, now the problem is that you need to pass a parameter to the stored procedure, right?
    Based on my research, it seems that we cannot achieve this requirement directly in current version of PowerPivot data model. Here is a similar thread for you reference.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/5350228d-bc62-4a3b-a1a6-e847483e2858/powerpivot-for-excel-2013-call-execute-stored-procedure-with-parameters?forum=sqlkjpowerpivotforexcel
    If you have any concern about this behavior, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that they can be, Microsoft might consider to add this feature
    in the following release after official confirmation.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Calling SQL Stored Procedure using Oracle Gateway

    Hi
    Do you know how i can call a stored procedure with parameters from Oracle using oracle gateway?

    Don't know which gateway you are using. Only the transparent gateway for SQL Server and Sybase that have support for stored procedures.
    Take a look at case 7 which shows how to do this.
    Rem case7.sql
    Rem
    Rem Copyright (c) Oracle Corporation 2000. All Rights Reserved.
    Rem
    Rem NAME
    Rem case7.sql
    Rem
    Rem DESCRIPTION
    Rem SQL script which executes the demo case7 for the
    Rem Transparent Gateways
    Rem
    Rem NOTES
    Rem The database link GTWLINK should be created before you can
    Rem run this demo file
    Rem
    Rem MODIFIED (MM/DD/YY)
    Rem kpeyetti 11/09/00 - Created
    Rem
    SET ECHO ON
    DROP TABLE LOCAL_GTW_DEPT;
    CREATE TABLE LOCAL_GTW_DEPT (DEPTNO INTEGER, DEPTNAME VARCHAR2(14));
    SELECT * FROM LOCAL_GTW_DEPT;
    DECLARE
    DNAME VARCHAR2(14);
    BEGIN
    "GetDept"@GTWLINK(10,DNAME);
    INSERT INTO LOCAL_GTW_DEPT VALUES (10, DNAME);
    END;
    SELECT * FROM LOCAL_GTW_DEPT;

  • Calling stored procedures with parameters with the Database Connectivi​ty Toolkit

    Hi all,
    I am new to the forum and am having difficulty finding a solution to a particular problem I am having regarding using the LabVIEW Database Connectivity Toolkit on a project I am currently working on at my job.  I have a database in which I have tables and stored procedures with parameters.  Some of these stored procedures have input, output, and return parameters.
    I have been trying to follow this example but to no avail:  http://digital.ni.com/public.nsf/allkb/07FD1307460​83E0686257300006326C4?OpenDocument
    One such stored procedure I am working on implementing is named "dbo.getAllowablePNs", which executes "SELECT * from DeviceType" (DeviceType is the table).  In this case, it does not require an input parameter, it has an output parameter that generates the table [cluster], and has a return parameter which returns an integer value (execution status code) to show if an error occurred.  The DeviceType table has 3 columns; ID (PK, int, not null), PN (nvarchar(15), null), and NumMACAddresses (int, null).  I have gone over many examples and have talking to NI support to try to implement this and similar stored procedures in LabVIEW but have not been successful.  I am able to connect to the database with the Open Connection VI without error, but am running into some confusion following this step.  I am then trying to use the Create Parameterized Query VI to call the stored procedure and set the parameters.  I assume I would then use the Set Parameter Value VI for each parameter that is wired into the parameters input on the previous Parameterized Query VI?  I am also having some confusion during and following these steps as well.  I would greatly appreciate any advice or suggestions anyone might have in regards to this situation as I am not a SQL expert.  Also, I would be happy to provide any more information that would be helpful.
    Regards,
    Jon
    Solved!
    Go to Solution.

    Also, I don't know if this would be helpful but here is the actual stored procedure in SQL:
    CREATEPROCEDURE [dbo].[getLastSequenceNumber]
    @p1 nvarchar(10)='WO-00000'
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SETNOCOUNTON;
    -- Insert statements for procedure here
    selectmax(SequenceNumber)from Devices where WorkOrderNumber= @p1
    END
    GO

  • Calling a stored procedure with default parameters

    Dear all,
    I am trying to call a stored procedure that has not all the parameters compulsory, and indeed, there are some I am not interested in. Therefore, I would like to call the stored procedure initializing only some of the parameters but if I miss some of them, I have an SQLException thrown. Is there any way to do that?
    Thanks
    Marie

    Hi
    One way to do it is ---
    By using Default Parameters you can miss few parameters while calling a procedure.
    =================================================================
    As the example below shows, you can initialize IN parameters to default values. That way, you can pass different numbers of actual parameters to a subprogram, accepting or overriding the default values as you please.
    Moreover, you can add new formal parameters without having to change every call to the subprogram.
    PROCEDURE create_dept (
    new_dname VARCHAR2 DEFAULT 'TEMP',
    new_loc VARCHAR2 DEFAULT 'TEMP') IS
    BEGIN
    INSERT INTO dept
    VALUES (deptno_seq.NEXTVAL, new_dname, new_loc);
    END;
    If an actual parameter is not passed, the default value of its corresponding formal parameter is used.
    Consider the following calls to create_dept:
    create_dept;
    create_dept('MARKETING');
    create_dept('MARKETING', 'NEW YORK');
    The first call passes no actual parameters, so both default values are used.
    The second call passes one actual parameter, so the default value for new_loc is used.
    The third call passes two actual parameters, so neither default value is used.
    Usually, you can use positional notation to override the default values of formal parameters.
    However, you cannot skip a formal parameter by leaving out its actual parameter.
    For example, the following call incorrectly associates the actual parameter 'NEW YORK' with the formal parameter new_dname:
    create_dept('NEW YORK'); -- incorrect
    You cannot solve the problem by leaving a placeholder for the actual parameter.
    For example, the following call is illegal:
    create_dept(, 'NEW YORK'); -- illegal
    In such cases, you must use named notation, as follows:
    create_dept(new_loc => 'NEW YORK');
    ===============================================================
    For more details refer URL http://technet.oracle.com/doc/server.804/a58236/07_subs.htm#3651
    Hope this helps
    Regards
    Ashwini

  • How do I call a DB2 Stored procedure?

    I am having problems trying to call a DB2 stored procedure.
    I am using the Service: Foundation -> JDBC 1.0 -> Call Stored Procedure.
    Stored procedure I am calling is (with 4 input params):
    CALL DB2D.SYSPROC.REGC1389(?, ?, ?, ?,
    {$ /process_data/@Name_Full $},
    {$ /process_data/@Name_Title $},
    {$ /process_data/@Name_Last $},
    {$ /process_data/@Name_Middle $},
    {$ /process_data/@Name_First $},
    {$ /process_data/@Name_Suffix $},
    {$ /process_data/@Address_1 $},
    {$ /process_data/@Address_2 $},
    {$ /process_data/@Address_3 $},
    {$ /process_data/@Address_City $},
    {$ /process_data/@Address_State $},
    {$ /process_data/@Address_Zip $},
    {$ /process_data/@ex_Code $},
    {$ /process_data/@Birthdate $},
    {$ /process_data/@ID_TypeCode_1 $},
    {$ /process_data/@ID_Number_1 $},
    {$ /process_data/@ID_TypeCode_2 $},
    {$ /process_data/@ID_Number_2 $},
    {$ /process_data/@ID_TypeCode_5 $},
    {$ /process_data/@ID_Number_5 $},
    {$ /process_data/@ID_TypeCode_6 $},
    {$ /process_data/@ID_Number_6 $},
    {$ /process_data/@ID_TypeCode_7 $},
    {$ /process_data/@ID_Number_7 $},
    {$ /process_data/@ID_TypeCode_8 $},
    {$ /process_data/@ID_Number_8 $},
    {$ /process_data/@ID_TypeCode_9 $},
    {$ /process_data/@ID_Number_9 $},
    {$ /process_data/@ID_TypeCode_10 $},
    {$ /process_data/@ID_Number_10 $},
    {$ /process_data/@ID_TypeCode_11 $},
    {$ /process_data/@ID_Number_11 $},
    {$ /process_data/@ID_TypeCode_12 $},
    {$ /process_data/@ID_Number_12 $},
    {$ /process_data/@ID_TypeCode_13 $},
    {$ /process_data/@ID_Number_13 $},
    {$ /process_data/@ID_TypeCode_14 $},
    {$ /process_data/@ID_Number_14 $},
    {$ /process_data/@ID_TypeCode_15 $},
    {$ /process_data/@ID_Number_15 $},
    {$ /process_data/@ID_TypeCode_16 $},
    {$ /process_data/@ID_Number_16 $},
    {$ /process_data/@ID_TypeCode_17 $},
    {$ /process_data/@ID_Number_17 $},
    {$ /process_data/@ID_TypeCode_18 $},
    {$ /process_data/@ID_Number_18 $},
    {$ /process_data/@Return_Code $},
    {$ /process_data/@SQL_RTNC $},
    {$ /process_data/@SQL_StateCode $},
    {$ /process_data/@SQL_Errmsg $});
    (I can call this same stored proc in ColdFusion, so the procedure does work.)
    The error message I get when I invoke it is:
    =======================================
    ALC-DSC-005-000: com.adobe.idp.dsc.DSCNotSerializableException: Not Serializable
    Caused by: ALC-DSC-000-000: com.adobe.idp.dsc.DSCRuntimeException: Internal error.
    at com.adobe.idp.workflow.dsc.invoker.WorkflowDSCInvoker.transientInvoke(WorkflowDSCInvoker. java:367)
    at com.adobe.idp.workflow.dsc.invoker.WorkflowDSCInvoker.invoke(WorkflowDSCInvoker.java:157)
    at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:140)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTr ansactionCMTAdapterBean.java:342)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doRequiresNew (EjbTransactionCMTAdapterBean.java:284)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EJSLocalStatelessEjbTransactionCMTAdapter_ caf58c4f.doRequiresNew(Unknown Source)
    at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:143)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInt erceptor.java:72)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(InvocationStra tegyInterceptor.java:55)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateIntercep tor.java:37)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:102)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:115)
    at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:118)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.invoke(AbstractMessageReceiv er.java:315)
    at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkEndpoint.invokeCall(SoapSdkEndpoint. java:138)
    at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkEndpoint.invoke(SoapSdkEndpoint.java :81)
    at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:618)
    at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
    at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
    at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
    at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
    at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1096)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1037)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
    at com.adobe.idp.dsc.provider.impl.soap.axis.InvocationFilter.doFilter(InvocationFilter.java :43)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java: 190)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:832)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:679)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:566)
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.jav a:90)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:748)
    at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:119)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink .java:458)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink .java:387)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConn ectionInitialReadCallback.java:214)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitia lReadCallback.java:113)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionLi stener.java:165)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
    Caused by: java.lang.RuntimeException: String Literal support for procedure calls to DB2/390 is disabled.  Failing SQL text CALL DB2D.SYSPROC.REGC1389(?, ?, ?, ?,
    at com.adobe.workflow.engine.PEUtil.invokeAction(PEUtil.java:837)
    at com.adobe.idp.workflow.dsc.invoker.WorkflowDSCInvoker.transientInvoke(WorkflowDSCInvoker. java:346)
    ... 66 more
    Caused by: java.lang.RuntimeException: String Literal support for procedure calls to DB2/390 is disabled.  Failing SQL text CALL DB2D.SYSPROC.REGC1389(?, ?, ?, ?,
    at com.adobe.idp.dsc.jdbc.helper.StoredProcedureHelper.callStoredProcedure(StoredProcedureHe lper.java:115)
    at com.adobe.idp.dsc.jdbc.JDBCService.callStoredProcedure(JDBCService.java:660)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:618)
    at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:118)
    at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:140)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionBMTAdapterBean.doBMT(EjbTran sactionBMTAdapterBean.java:197)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EJSLocalStatelessEjbTransactionBMTAdapter_ 3af08fdf.doBMT(Unknown Source)
    at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:95)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInt erceptor.java:72)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(InvocationStra tegyInterceptor.java:55)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateIntercep tor.java:37)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:132)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:115)
    at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:118)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.routeMessage(AbstractMessage Receiver.java:91)
    at com.adobe.idp.dsc.provider.impl.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:21 5)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:57)
    at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
    at com.adobe.workflow.engine.PEUtil.invokeAction(PEUtil.java:724)
    ... 67 more
    Caused by: com.ibm.db2.jcc.c.SqlException: String Literal support for procedure calls to DB2/390 is disabled.  Failing SQL text CALL DB2D.SYSPROC.REGC1389(?, ?, ?, ?,
    at com.ibm.db2.jcc.c.ig.i(ig.java:2531)
    at com.ibm.db2.jcc.c.jg.b(jg.java:292)
    at com.ibm.db2.jcc.c.jg.<init>(jg.java:263)
    at com.ibm.db2.jcc.c.kg.<init>(kg.java:72)
    at com.ibm.db2.jcc.a.fc.<init>(fc.java:91)
    at com.ibm.db2.jcc.a.b.b(b.java:1959)
    at com.ibm.db2.jcc.c.p.a(p.java:2317)
    at com.ibm.db2.jcc.c.p.prepareCall(p.java:1909)
    at com.ibm.db2.jcc.c.nc.prepareCall(nc.java:246)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.pmiPrepareCall(WSJdbcConnection.java:1832)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareCall(WSJdbcConnection.java:1959)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareCall(WSJdbcConnection.java:1914)
    at com.adobe.idp.dsc.jdbc.helper.StoredProcedureHelper.callStoredProcedure(StoredProcedureHe lper.java:105)
    ... 96 more
    at com.adobe.idp.dsc.provider.impl.base.AbstractResponseHolder.handleException(AbstractRespo nseHolder.java:136)
    at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkBindingStubUtil.deSerializeResponse( SoapSdkBindingStubUtil.java:122)
    at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapAxisDispatcher.doSend(SoapAxisDispatche r.java:128)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:57)
    at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
    at com.adobe.common.utils.invoke.InvokeWithProgressRunner.invokeServiceOperation(InvokeWithP rogressRunner.java:170)
    at com.adobe.common.utils.invoke.InvokeWithProgressRunner.run(InvokeWithProgressRunner.java: 97)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
    =======================================
    I am using the JDBC Provider: DB2 Universal JDBC Provider
    Implementation class name : com.ibm.db2.jcc.DB2ConnectionPoolDataSource
    For the Data source : DB2D
    Data store helper class name:Data store helper classes provided by WebSphere Application Server
    This is my first attempt at calling a DB2 stored procedure, so any tips on how to make it work would be appreciated.
    Thanks
    Jim

    Jasmin,
    Thanks for the "db2.jcc.supportZosSpLiterals=yes" configuration property suggestion.
    I worked with our WebSphere support team to set this property.  We set it as a Custom Property in the data source.
    The DB2 driver version is higher then the APAR which supports this property, but it doesn't seem to recognize it.
    [8/28/09 11:15:42:775 CDT] 0000003f DSConfigurati W DSRA8200W: DataSource Configuration: DSRA8020E: Warning: The property 'supportZosSpLiterals' does not exist on the DataSource class com.ibm.db2.jcc.DB2ConnectionPoolDataSource.
    [8/28/09 11:15:43:337 CDT] 0000003f InternalDB2Un I DSRA8203I: Database product name : DB2
    [8/28/09 11:15:43:353 CDT] 0000003f InternalDB2Un I DSRA8204I: Database product version : DSN08015
    [8/28/09 11:15:43:353 CDT] 0000003f InternalDB2Un I DSRA8205I: JDBC driver name : IBM DB2 JDBC Universal Driver Architecture
    [8/28/09 11:15:43:353 CDT] 0000003f InternalDB2Un I DSRA8206I: JDBC driver version : 2.11.24
    [8/28/09 11:15:43:369 CDT] 0000003f InternalDB2Un I DSRA8212I: DataStoreHelper name is: [email protected]
    [8/28/09 11:15:43:384 CDT] 0000003f WSRdbDataSour I DSRA8208I: JDBC driver type : 4
    Are we setting the property in the right place?  What version of the DB2 driver is needed for this property?  Any other tips?
    Thanks
    Jim

  • Calling a Stored Procedure with output parameters from Query Templates

    This is same problem which Shalaka Khandekar logged earlier. This new thread gives the complete description about our problem. Please go through this problem and suggest us a feasible solution.
    We encountered a problem while calling a stored procedure from MII Query Template as follows-
    1. Stored Procedure is defined in a package. Procedure takes the below inputs and outputs.
    a) Input1 - CLOB
    b) Input2 - CLOB
    c) Input3 - CLOB
    d) Output1 - CLOB
    e) Output2 - CLOB
    f) Output3 - Varchar2
    2. There are two ways to get the output back.
    a) Using a Stored Procedure by declaring necessary OUT parameters.
    b) Using a Function which returns a single value.
    3. Consider we are using method 2-a. To call a Stored Procedure with OUT parameters from the Query Template we need to declare variables of
    corresponding types and pass them to the Stored Procedure along with the necessary input parameters.
    4. This method is not a solution to get output because we cannot declare variables of some type(CLOB, Varchar2) in Query Template.
    5. Even though we are successful (step 4) in declaring the OUT variables in Query Template and passed it successfully to the procedure, but our procedure contains outputs which are of type CLOB. It means we are going to get data which is more than VARCHAR2 length which query template cannot return(Limit is 32767
    characters)
    6. So the method 2-a is ruled out.
    7. Now consider method 2-b. Function returns only one value, but we have 3 different OUT values. Assume that we have appended them using a separator. This value is going to be more than 32767 characters which is again a problem with the query template(refer to point 5). So option 2-b is also ruled out.
    Apart from above mentioned methods there is a work around. It is to create a temporary table in the database with above 3 OUT parameters along with a session specific column. We insert the output which we got from the procedure to the temporary table and use it further. As soon the usage of the data is completed we delete the current session specific data. So indirectly we call the table as a Session Table. This solution increases unnecessary load on the database.
    Thanks in Advance.
    Rajesh

    Rajesh,
    please check if this following proposal could serve you.
    Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
    Here is an example how this could be defined.
    Package:
    type return_cur IS ref CURSOR;
    Procedure:
    PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
    OPEN myReturnCur FOR SELECT val1, val2, val3  FROM dual;
    Query:
    DECLARE
      MYRETURNCUR myPackage.return_cur;
    BEGIN
      myPackage.myProc(
        MYRETURNCUR => ?
    END;
    Good luck.
    Michael

  • JDBC receiver adapter to call MS SQLServer stored procedure with parameters

    We are trying to use the JDBC receiver adapter to call a stored procedure in MS SQLServer with parameters.  According to the help documentation for the JDBC receiver adapter for action=EXECUTE,  "The elements within the stored procedure are interpreted as parameters" and "The parameter names must be identical to those of the stored procedure definition".  The parameters within a MS SQLServer stored procedure are required to begin with the '@' symbol.  The element names within a XML document i.e. used to call the stored procedure can not contain a special character such as '@' in the first position.  For all of the tests we have done where the parameter name in the XML document omits the '@' character, the parameters are not being received by the stored procedure.  Is there a way around this  problem?
    Thank you,
    Harold

    Hello Harold - I am facing the EXACTLY SAME problem.Pls let me know how did you fix this problem ?
    This is the message I am passing on to the DB SP:
    <?xml version="1.0" encoding="UTF-8"?>
    <MRIRequestInbound>
       <StatementName>
          <prc_FC_InsertStagingJournalEntries action="EXECUTE"/>
          <JournalData isInput="true" type="STRING">
    <NewDataSet><Table ITEM = "" ENTITYID = "" PERIOD = "" ACCTNUM = "" DEPARTMENT = "" JOBCODE = "" AMT = "" REF = "" DESCRPN = "" ENTRDATE = "" BASIS = " " BALFOR = "N" REQUESTNUM = "" ACCTNAME = "" TYPE = "" DESCRPTN = "" GDEP_DESCRPN = "" GJOB_DESCRPTN = "" JOBTYPE = ""  /></NewDataSet>
    </JournalData>
       </StatementName>
    </MRIRequestInbound>
    Out of which,
    <NewDataSet> tag contains the value of the parameter in the SP. So, my value to the SP's parameter is :
    <NewDataSet><Table ITEM = "" ENTITYID = "" PERIOD = "" ACCTNUM = "" DEPARTMENT = "" JOBCODE = "" AMT = "" REF = "" DESCRPN = "" ENTRDATE = "" BASIS = " " BALFOR = "N" REQUESTNUM = "" ACCTNAME = "" TYPE = "" DESCRPTN = "" GDEP_DESCRPN = "" GJOB_DESCRPTN = "" JOBTYPE = ""  /></NewDataSet>
    Any clue ?
    Cheers,
    Amrish.

Maybe you are looking for