Bea type 4 db2 driver-stored procedure error

Iam creating a connection pool in weblogic 9.2 MP2
using bea type 4 db2 driver and excuting a stored procedure.Iam getting following error
I enabled spy
spy(2008/02/13 09:41:58.050)>> Driver Name = DB2
spy(2008/02/13 09:41:58.050)>> Driver Version = 3.60.24 (023731.010811.022315)
spy(2008/02/13 09:41:58.050)>> Database Name = DB2/MVS
spy(2008/02/13 09:41:58.050)>> Database Version = 8.1.5
spy(2008/02/13 09:44:11.063)>> java.sql.SQLException: [BEA][DB2 JDBC Driver][DB2]UNACCEPTABLE SQL STATEMENT ErrorCode=-84 SQL
State=42612
The code is using
CALL SP03 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
as follows
String sql = "CALL SP03 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
myCallableStmt = con.prepareCall(sql);
is ther are any issues in calling stored procedure with type 4 bea db2 driver.
connectrion pool details
jdbc:bea:db2://server:447
weblogic.jdbc.db2.DB2Driver
user=user
LocationName=server
portNumber=447
serverName=host
batchPerformanceWorkaround=true
The code is working fine with type 2 ibm driver connection pool
Also Iam trying with ibm type 4 driver
Iam getting following error in configuration itself
<Feb 13, 2008 11:18:44 AM EST> <Error> <JDBC> <BEA-001112> <Test "SELECT COUNT(*) FROM
abc.xy_def" set up for pool "DataSourceIBM" failed with exception: "com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -725,
SQLSTATE: 42721, SQLERRMC: CLIENT APPLNAME;server".>
details
jdbc:db2://mvsavt1_vipa.corpny.csfb.com:447/server
com.ibm.db2.jcc.DB2Driver
user=user
locationName=server
portNumber=450
drivertype=4
Any configuration required at db2 server

Ok, Odd. Please email this post (the code below) and the
output of each to [email protected] and ask them to investigate
why one driver finds the procedure and the other doesn't.
This will get back to me officially, and then I will be able
to enlist all the resources to debug it. Is the stored
procedure owned by the same schema as your 'user'?
Mohamed Rabbani P M wrote:
Joe,
It is the same code you gave
BEA Driver Code
import java.io.*;
import java.util.*;
import java.net.*;
import java.sql.*;
import weblogic.common.*;
public class dddb2
public static void main(String argv[])
throws Exception
Connection c = null;
try
java.util.Properties props = new java.util.Properties();
Driver d = (Driver)Class.forName("weblogic.jdbc.db2.DB2Driver").newInstance();
props.put("user", "user");
props.put("password", "password");
props.put("locationName", "dbserver");
String URL = "jdbc:bea:db2://dbhost:447";
c = d.connect(URL, props);
DatabaseMetaData dm = c.getMetaData();
System.out.println(dm.getDriverVersion());
System.out.println("Database version is " + dm.getDatabaseProductVersion() );
CallableStatement p = c.prepareCall("{ CALL SP03 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }");
p.setInt(1,1234);
p.setString(2,"XYZ");
p.setString(3,"XYZ");
p.setInt(5,1234);
p.setString(6,"");
p.setString(7,"XYZ");
p.setString(9,"XYZ");
p.setString(12,"XYZ");
p.registerOutParameter(4,Types.INTEGER);
p.registerOutParameter(8,Types.INTEGER);
p.registerOutParameter(10,Types.INTEGER);
p.registerOutParameter(11,Types.INTEGER);
p.registerOutParameter(13,Types.INTEGER);
p.setFetchSize(3);
p.execute();
catch (Exception e)
{ e.printStackTrace(); }
finally
{ try {c.close();}catch (Exception e){} }
IBM Driver Code
import java.io.*;
import java.util.*;
import java.net.*;
import java.sql.*;
import weblogic.common.*;
public class dddb2ibm
public static void main(String argv[])
throws Exception
Connection c = null;
try
java.util.Properties props = new java.util.Properties();
Driver d = (Driver)Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
props.put("user", "user");
props.put("password", "password");
//props.put("databaseName", "dbserver");
String URL = "jdbc:db2://dbhost:447/dbserver";
c = d.connect(URL, props);
DatabaseMetaData dm = c.getMetaData();
System.out.println(dm.getDriverVersion());
System.out.println("Database version is " + dm.getDatabaseProductVersion() );
CallableStatement p = c.prepareCall("{ CALL SP03 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }");
p.setInt(1,1234);
p.setString(2,"XYZ");
p.setString(3,"XYZ");
p.setInt(5,1234);
p.setString(6,"");
p.setString(7,"XYZ");
p.setString(9,"XYZ");
p.setString(12,"XYZ");
p.registerOutParameter(4,Types.INTEGER);
p.registerOutParameter(8,Types.INTEGER);
p.registerOutParameter(10,Types.INTEGER);
p.registerOutParameter(11,Types.INTEGER);
p.registerOutParameter(13,Types.INTEGER);
p.setFetchSize(3);
p.execute();
catch (Exception e)
{ e.printStackTrace(); }
finally
{ try {c.close();}catch (Exception e){} }

Similar Messages

  • SSRS Calling a Stored Procedure error : PLS-00306: wrong number or types of arg...

    Hi,
    My Problem is when im adding dataset with stored procedure, im getting this error.
    I Can access database, 
    Could not create a list of fields for the query. Verify that you can connect to the data source and that your query syntax is correct.
    ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'PROCEDURE_NAME' ORA-06550: line 1, column 7: PL/SQL:
    Statement ignored
    stored procedure is simple select :
    CREATE OR REPLACE PROCEDURE [PROCEDURE_NAME](L_CURSOR out SYS_REFCURSOR)
    is
    Begin
    open L_CURSOR for
    SELECT [columnname] FROM
    [tablename]
    End;
    Configuration Details:
    DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64biOracle Developer Tools for Visual Studio Copyright (c) 2005,2014 SQL Server Data Tools Type: Oracle , Data Provider : .Net Framework Data Provider For Oracle

    The answer is of inside question. It is about provider. Change my provider ODTwithODAC for 10g (my database version). And problem resolved.
    Thank you for your helps,
    Regards,
    Arda

  • Crystal Report That Uses Stored Procedure Errors when connecting to the DB

    We had developed reports a few years ago, including one that calls a Stored Procedure on an iSeries AS400 DB2 database.  We upgraded our environments to Crystal Reports 2008 and BO XI 3.1.  Now, the existing report that previously ran in the old environment is not running (note that the other SQL-based reports work without a problem, only this one which uses a store procedure is not working).  I downloaded the report into my local Crystal Reports designer and tried to run it from there and I got the following error message:
    ======
    Failed to retieve data from the database.
    Details: ADO Error Code: 0x
    Source Microsoft OLE DB Provider for ODBC Drivers
    Description: [IBM][iSeries Access ODBC Driver] Statement violates access rule:  Connection is set to read only.
    SQL State: 37000
    Native Error: [Database Vendor Code: 30186 ]
    ======
    {CALL "<database>"."<library>"."RELEASEDNOTINVOICE"({d '2010-03-01'})}
    This call will still work from on a SQL client running on a JDBC connection.  Is there some problem with the new verion of BO and Crystal Reports with using the iSeries ODBC driver?

    ...my issue was resolved by setting the ODBC.INI registry entry for AllowProcCalls from 0 to 1.

  • Stored Procedure error with JDBC:ODBC

    Hi,
    I am trying to run a stored procedure on RDMS (Uniaccess ODBC). This has 2 input parameters and returns a resultset of 3 columns. The following is the error I am getting and am stumped. Please help..
    (similar call statement works with VB and ADO)
    --------output ---------------
    Calling MGC005
    inside resultset sun.jdbc.odbc.JdbcOdbcCallableStatement@129206
    row 1
    get string 0004
    get string 00000
    get string
    SQLEcception : java.sql.SQLException: [AIS][UniAccess ODBC Driver]Invalid Column Number//Specified column is before the column specified in the previous call
    ----------------------source code ------------------
    import java.awt.Graphics;
    import java.sql.*;
    public class JdbcTest {
    public JdbcTest() {
         Connection con;
         CallableStatement stmt;
    try {
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
    catch (Exception ex) {
    System.out.println ("Database Driver not found");
    System.exit(0);
    try {
    String msDbUrl = "jdbc:odbc:CMS_TEST_ODBC";
    con = DriverManager.getConnection(msDbUrl, user, password );
    stmt = con.prepareCall("{ call MGC005(?, ?)}");
              stmt.setString( 1, "CH" );
              stmt.setString( 2, "ARRINGTON0909170320010615" );
    //          stmt.registerOutParameter( 1, java.sql.Types.VARCHAR);
    //          stmt.registerOutParameter( 2, java.sql.Types.VARCHAR );
    //           stmt.registerOutParameter( 3, java.sql.Types.VARCHAR );
              System.out.println( "Calling MGC005 " );
         ResultSet rs = stmt.executeQuery();
              while (rs.next()) {
    System.out.println( " inside resultset " + rs.getStatement() );
    System.out.println( " row " + rs.getRow() );
    System.out.println( " get string " + rs.getString(1) );
    System.out.println( " get string " + rs.getString(2) );
    System.out.println( " get string " + rs.getString(3) );
              String i = rs.getString (1);
              String s = rs.getString (2);
              String t = rs.getString (3);
    String text = i + " " + s ;
    System.out.println ( " Output " + text);
         stmt.close();
    con.close();
    } catch( SQLException ex ) {
    System.out.println ("SQLEcception : " + ex);
    public static void main(String[] args) {
    new JdbcTest();
    }

    Hi,
    The error seems to occur on the line:
    String i = rs.getString (1);
    The error exactly states what is occuring: "Specified column is before the column specified in the previous call". Try limiting the call to getString() to one for each column for each row.
    Try replacing these lines:
    System.out.println( " get string " + rs.getString(1) );
    System.out.println( " get string " + rs.getString(2) );
    System.out.println( " get string " + rs.getString(3) );
    String i = rs.getString (1);
    String s = rs.getString (2);
    String t = rs.getString (3);
    with something like:
    String i = rs.getString (1);
    System.out.println( " get string " + i);
    String s = rs.getString (2);
    System.out.println( " get string " + s);
    String t = rs.getString (3);
    System.out.println( " get string " + t);
    Hope this works,
    Kurt.

  • Callable statement with oracle stored procedure error

    i'm calling a stored procedure in java with the following code. However i constantly recieve this error
    so what is going on please HELP
    Parameter Type Conflict: sqlType=2006
    my call statement would be this:
    call Statement = {call getUserByLogin(?,?,?,?)}
    if(storedProcedureName=="getUserByLogin"){
    strCStmt = ("{call " + storedProcedureName +"(?,?,?,?) }");
    cStmt.setObject(1, "system");
    cStmt.setObject(2, "username");
    cStmt.setObject(3,"password");
    cStmt.registerOutParameter(4, java.sql.Types.REF);
    rs = cStmt.executeQuery();
    i've also tried it with a setString as the IN parameter:
    here's the stored procedure:
    CREATE OR REPLACE PROCEDURE getUserByLogin (
    arg_subscriptionName IN varchar,
    arg_loginName IN varchar,
    arg_password IN varchar,
    arg_rec_userinfo_valLanguage OUT types.rec_userinfo_valLanguage
    ) AS
    var_userNum int;
    BEGIN
    select
    u.userNum into var_userNum
    from
    userInfo u,
    subscription s
    where
    s.subscriptionName = arg_subscriptionName AND
    s.subscriptionNum = u.subscriptionNum AND
    u.loginName = arg_loginName AND
    u.password = arg_password;
    if (var_userNum is null) then
    var_userNum := 0;
    end if;
    getUser(var_userNum, arg_rec_userinfo_valLanguage);
    END;

    i'm calling a stored procedure in java with the
    following code. However i constantly recieve this
    error
    so what is going on please HELP
    Parameter Type Conflict: sqlType=2006
    my call statement would be this:
    call Statement = {call getUserByLogin(?,?,?,?)}
    if(storedProcedureName=="getUserByLogin"){
    strCStmt = ("{call " + storedProcedureName +"(?,?,?,?)
    cStmt.setObject(1, "system");
    cStmt.setObject(2, "username");
    cStmt.setObject(3,"password");
    cStmt.registerOutParameter(4, java.sql.Types.REF);
    rs = cStmt.executeQuery();
    i've also tried it with a setString as the IN
    parameter:
    here's the stored procedure:
    CREATE OR REPLACE PROCEDURE getUserByLogin (
    arg_subscriptionName IN varchar,
    arg_loginName IN varchar,
    arg_password IN varchar,
    arg_rec_userinfo_valLanguage OUT
    types.rec_userinfo_valLanguage
    ) AS
    var_userNum int;
    BEGIN
    select
    u.userNum into var_userNum
    from
    userInfo u,
    subscription s
    where
    s.subscriptionName = arg_subscriptionName AND
    s.subscriptionNum = u.subscriptionNum AND
    u.loginName = arg_loginName AND
    u.password = arg_password;
    if (var_userNum is null) then
    var_userNum := 0;
    end if;
    getUser(var_userNum, arg_rec_userinfo_valLanguage);
    END;
    /Hai,
    Try with this if u are using Oracle.
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    (inbetween ur code)
    cStmt.registerOutParameter(4, OracleTypes.CURSOR);
    //in place of "cStmt.registerOutParameter(4, java.sql.Types.REF);"
    Hope u reply with joy.
    regards,
    Siva Kumar Annavaram

  • "table type" result from stored procedure (Oracle 10g) for physical service

    Hello,
    I'm trying to create a physical service based on a stored procedure which returns a table type like this:
    SQL
    -- create table
    create table myTable ( "col1" VARCHAR2(250) not null enable, "filtercol1" VARCHAR2(250), "filtercol2" VARCHAR2(250), "sortcol1" VARCHAR2(250), "sortcol2" VARCHAR2(250), "sortcol3" VARCHAR2(250))
    -- create return type
    create or replace type myResultType as table of varchar2(250);
    -- create function
    create or replace function getResult(param1 in varchar2, param2 in varchar2, orderby in varchar2) return myResultType as
    query_str VARCHAR2(1000);
    myResult myResultType;
    begin
    query_str := 'select m.col1 from myTable m where m.filtercol1 like :param1 and m.filtercol2 like :param2 order by ' || orderby;
    execute immediate query_str bulk collect into myResult using param1, param2;
    return myResult;
    end getResult;
    The wizard for creating the physical service complains that it can't find the return type and I have to create a schema by myself. How should it look like? I can't find a sample in the documentation.
    Thanks for any help,
    Guido

    Ok, now the wizard produces something like this:
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="protected" kind="library" isPrimary="false" nativeName="GETRESULT" nativeLevel2Container="MY_SCHEMA" style="storedProcedure">
    <nonCacheable/>
    <params xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes" xmlns:pn1="ld:physical/SQLServices/MY_TMP_TABLE" >
    <param name="RETURN_VALUE" kind="return" xqueryType="pn1:MY_TMP_TABLE" nativeTypeCode="0" nativeType="RowSet"/>
    <param name="RETURN_VALUE" kind="out" xqueryType="pn1:MY_TMP_TABLE" nativeTypeCode="0" nativeType="RowSet"/>
    <param name="PARAM1" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="PARAM2" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    <param name="ORDERBY" kind="in" xqueryType="xs:string" nativeTypeCode="12" nativeType="VARCHAR2"/>
    </params>
    </f:function>::)
    declare procedure f1:GETRESULT($PARAM1 as xs:string, $PARAM2 as xs:string, $ORDERBY as xs:string) as schema-element(t1:GETRESULT) external;
    Then WorkSpace Studio complains about: "... error: cos-element-consistent: Type of 'RETURN_VALUE' is inconsistent with another element with the same name in this content model. "
    If I rename one RETURN_VALUE to RETURN_VALUE1 (the param name and in the schema file) the error is gone, but if I try to test the method I get:
    com.bea.dsp.das.exception.DASException: weblogic.xml.query.exceptions.XQuerySagaException: {bea-err}UPD003: Update failure: mixed outcome, update error dispatched (updateid=SAGA_596ba32b1ff8d8a4:181f0b20:11f92ed2529:-7fe2): java.lang.RuntimeException: Konflikt bei Parametertyp
         at com.bea.dsp.das.ejb.EJBClient.invokeOperation(EJBClient.java:160)
         at com.bea.dsp.das.DataAccessServiceImpl.invokeOperation(DataAccessServiceImpl.java:171)
         at com.bea.dsp.das.DataAccessServiceImpl.invoke(DataAccessServiceImpl.java:122)
         at com.bea.dsp.ide.xquery.views.test.QueryExecutor.invokeFunctionOrProcedure(QueryExecutor.java:121)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.getFunctionExecutionResult(XQueryTestView.java:1006)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.executeFunction(XQueryTestView.java:1134)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedImpl(XQueryTestView.java:1807)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.access$300(XQueryTestView.java:159)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent$3.run(XQueryTestView.java:1535)
         at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedBusy(XQueryTestView.java:1538)
         at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelected(XQueryTestView.java:1500)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
         at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
         at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.eclipse.core.launcher.Main.invokeFramework(Main.java:339)
         at org.eclipse.core.launcher.Main.basicRun(Main.java:283)
         at org.eclipse.core.launcher.Main.run(Main.java:984)
         at org.eclipse.core.launcher.Main.eclipse_main(Main.java:959)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.m7.installer.util.NitroxMain$1.run(NitroxMain.java:39)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    "Konflikt bei Parametertyp" means something like: parameter type conflict
    Best regards,
    Guido

  • JDBC adapter Stored Procedure error: parameter was not supplied

    I am trying to call a Stored Procedure 'SP_FUSION_DEBMS_ADRC_MANAGE_CUSTOMER_ADDRESS' in our SQL Server database.
    XI 3.0 Sp13
    Jdbc Url: jdbc:microsoft:sqlserver://161.241.255.91:1433;databaseName=FusionDB;SelectMethod=Cursor
    I am getting following error:
    beging of error-----
    Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP_FUSION_DEBMS_ADRC_MANAGE_CUSTOMER_ADDRESS' (structure 'Statement1'): java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Procedure 'SP_FUSION_DEBMS_ADRC_MANAGE_CUSTOMER_ADDRESS' expects parameter '@control_no', which was not supplied.
    End of error-----
    I have defined the field "control_no" in the interface defenition but I am not sure what causing this error, error message is mis-leading.
    Please let me know if you have any hints/comments?
    thanks,
    Laxman molugu

    Hi Laxman,
    maybe you have checked this already...from the following help link....DECIMAL might be something you might want to try out....
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
    <i>action=EXECUTE
    Statements with this action result in a stored procedure being executed. The name of the element is interpreted as the name of the stored procedure in the database. If you use the optional <table> element, the value specified here is used as the stored procedure name. This enables you, for example, to define stored procedure names containing non-XML-compatible characters or characters that prevent them from being used in interface definitions in the Integration Builder/PCK.  If specified, <table> must be the first element in the block within <dbTableName>.
    The elements within the stored procedure are interpreted as parameters. They can optionally have the attribute isInput=“1“ (input parameter) or isOutput=“1“ (output parameter) or both (INOUT parameter). If both attributes are missing, the element is interpreted as an input parameter. The parameter names must be identical to those of the stored procedure definition.
    The attribute type=<SQL-Datatype> , which describes the valid SQL data type, is mandatory for all parameter types (IN, OUT, INOUT).
    The following SQL data types are supported:
    INTEGER, BIT, TINYINT, SMALLINT, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL, CHAR, VARCHAR, STRING, LONGVARCHAR, DATE, TIME, TIMESTAMP, BINARY, VARBINARY, LONGVARBINARY, BLOB (input and output),CLOB (input and output), CURSOR (output; only in conjunction with the Oracle JDBC driver).</i>

  • Retrieving PL/SQL Table Type returned by stored procedure using Java.

    Hi All,
    I am facing an issue in a Stored Procedure (SP) which returns Table Type, the PL/SQL complex type.
    Below mentioned is how my stored procedure looks like.
    CREATE OR REPLACE package sp_test_pkg as
    TYPE v_value_table_type is table of SW_VALID_CODE.swValue%Type
    index by binary_integer;
    v_swRMAStatus v_value_table_type;
    procedure sp_test
    (locale      in int,
              name      in SW_CODE.swName%Type,
              v_value_table out v_value_table_type,
    batch_size in int,
    out_batch_size in out int,
    status out int);
    end sp_test_lcode_code_pkg;
    My java program to access this stored procedure is as given below:
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public class OracleTest {       
         public static void main(String args[]) {
         Connection con = null;
    OracleCallableStatement cstmt = null;
    String url = "url";
         String userName = "username";     
         String password = "password";
    try
              DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());     
              con = DriverManager.getConnection(url, userName, password);
         cstmt = (OracleCallableStatement)con.prepareCall("begin " +
              "sp_test_pkg.sp_test_pkg(?,?,?,?,?,?); end;");
              cstmt.setInt(1, 1);
         cstmt.setString(2, "Test");
              cstmt.registerOutParameter(3, OracleTypes.ARRAY);
              cstmt.setInt(4, 10);
              cstmt.setInt(5, 1);
              cstmt.registerOutParameter(5, Types.INTEGER);
              cstmt.registerOutParameter(6, Types.INTEGER);
              cstmt.execute();
    } catch(Exception ex) {
    ex.printStackTrace(System.err);
    } finally {
    if(cstmt != null) try{cstmt.close();}catch(Exception _ex){}
    if(con != null) try{con.close();}catch(Exception _ex){}
    When i execute this java program, i get the following error:
    java.sql.SQLException: Parameter Type Conflict: sqlType=2003
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:187)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:229)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterBytes(OracleCallableStatement.java:245)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:389)
         at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:452)
         at OracleTest.main(OracleTest.java:49)
    I am not sure where i am going wrong. I have never worked on such complex types before. I want to retrieve the complex table type returned by the stored procedure using my java source code.
    Can anyone please help me out in resolving this issue?. This is very urgent.

    JDBC does not recognise types declared in PL/SQL. This is documented in the Dev Guide. [Find out more|http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/oraarr.htm#1057625].
    The only work around would be to build a wrapper which calls your existing PL/SQL procedures and returns a SQL type instead. Obviously not knowing your precise scenario I have no idea how much work this entails for you. It may be worth building a code generator.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • ORABPEL-11809 - call a stored procedure - error in OUT parameter

    Hi all.
    I have a problem in a BPEL process that calls a stored procedure.
    I create a Partner Link that calls a stored procedure in the database. That procedure returns a type that is a table (is defined as a type of the database).
    When I deploy the process I have the following error:
    <messages>
    - <input>
    - <WC01_Pesquisa_Ut_InputVariable>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="InputParameters">
    - <InputParameters xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/">
    <P_NIR xmlns="">
    165968274
    </P_NIR>
    <P_NOME_COMPLETO xmlns="">
    carla diogo
    </P_NOME_COMPLETO>
    <P_SEXO xmlns="">
    Feminino
    </P_SEXO>
    <P_DATA_NASC xmlns="">
    2007-03-01
    </P_DATA_NASC>
    <P_NATURALIDADE xmlns=""/>
    </InputParameters>
    </part>
    </WC01_Pesquisa_Ut_InputVariable>
    </input>
    - <fault>
    - <remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
    - <part name="code">
    <code>
    17002
    </code>
    </part>
    - <part name="summary">
    <summary>
    file:/oracle/product/10.1.3/SOA/Integration10131/bpel/domains/default/tmp/.bpel_SaudeIdentificarCidadao_5.0_e3768f57d137443e1ba52d4a6d809426.tmp/WC01_Pesquisa_Ut.wsdl [ WC01_Pesquisa_Ut_ptt::WC01_Pesquisa_Ut(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'WC01_Pesquisa_Ut' failed due to: Error registering an out parameter.
    An error occurred when registering parameter PESQUISA_UT as an out parameter of the IGIF.WC01.PESQUISA_UT API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
    ; nested exception is:
         ORABPEL-11809
    Error registering an out parameter.
    An error occurred when registering parameter PESQUISA_UT as an out parameter of the IGIF.WC01.PESQUISA_UT API. Cause: java.sql.SQLException: Io exception: Connection reset [Caused by: Io exception: Connection reset]
    Check to ensure that the parameter is a valid IN/OUT or OUT parameter of the API. Contact oracle support if error is not fixable.
    </summary>
    </part>
    - <part name="detail">
    <detail>
    Internal Exception: java.sql.SQLException: Io exception: Connection resetError Code: 17002
    </detail>
    </part>
    </remoteFault>
    </fault>
    </messages>
    The code of the XSD created when I create the partner link is:
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/IGIF/WC01/PESQUISA_UT/"
    elementFormDefault="unqualified" attributeFormDefault="unqualified">
    <element name="InputParameters">
    <complexType>
    <sequence>
    <element name="P_NIR" type="decimal" db:index="1" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="P_NOME_COMPLETO" type="string" db:index="2" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="P_SEXO" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="P_DATA_NASC" type="dateTime" db:index="4" db:type="DATE" minOccurs="0" nillable="true"/>
    <element name="P_NATURALIDADE" type="string" db:index="5" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <element name="OutputParameters">
    <complexType>
    <sequence>
    <element name="PESQUISA_UT" type="db:TABELA_DE_IDS" db:index="0" db:type="Array" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="TABELA_DE_IDS">
    <sequence>
    <element name="PESQUISA_UT_ITEM" type="decimal" db:type="NUMBER" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
    </sequence>
    </complexType>
    </schema>
    Any ideia?
    Thanks in advance.
    Carla

    I'd suggest that you turn on xml validation on the bpel boundaries to make sure that the xml being passed to the adapter is valid. You do this by logging in to bpel console, go to Manage Domain, at the bottom of the Configuration tab, set validateXml to true.
    Then see if it is an xml validation issue - in which case you will have to fix your maps to make sure it is valid indeed.
    Assuming your XML is valid and you are still seeing this error, couple of follow up questions:
    - are you using synonyms ?
    -- note that synonyms are not supported completely by the adapter at this time.
    - could you spell out where your types/sp-pkg resides and what are you connecting as at runtime ?
    -- just to keep things simple enough to debug, i'd do everything as just one user and slowly go to a scheme that you desire.
    HTH

  • Passing Arrays of User Defined Types to Oracle Stored Procedures

    Hi
    I am using WebLogic 8.14 & Oracle 9i with thin JDBC driver.
    Our application needs to perform the same DB operation for every item in a Java Collection. I cannot acheive the required performance using the standard Prepare & Execute loop and so I am looking to push the whole collection to Oracle in a single invocation of a Stored Procedure and then loop on the database.
    Summary of Approach:
    In the Oracle database, we have defined a Object Type :
    CREATE OR REPLACE
    TYPE MYTYPE AS OBJECT
    TxnId VARCHAR2(40),
    Target VARCHAR2(20),
    Source VARCHAR2(20),
    Param1 VARCHAR2(2048),
    Param2 VARCHAR2(2048),
    Param3 VARCHAR2(2048),
    Param4 VARCHAR2(2048),
    Param5 VARCHAR2(2048),
    and we have defined a collection of these as:
    CREATE OR REPLACE
    TYPE MYTYPE_COLLECTION AS VARRAY (100) OF MYTYPE
    There is a stored procedure which takes one of these collections as an input parameter and I need to invoke these from within my code.
    I am having major problems when I attempt to get the ArrayDescriptor etc to allow me to create an Array to pass to the stored procedure. I think this is because the underlying Oracle connection is wrapped by WebLogic.
    Has anyone managed to pass an array to an Oracle Stored procedure on a pooled DB connection?
    Thanks
    Andy

    Andy Bowes wrote:
    Hi
    I am using WebLogic 8.14 & Oracle 9i with thin JDBC driver.
    Our application needs to perform the same DB operation for every item in a Java Collection. I cannot acheive the required performance using the standard Prepare & Execute loop and so I am looking to push the whole collection to Oracle in a single invocation of a Stored Procedure and then loop on the database.
    Summary of Approach:
    In the Oracle database, we have defined a Object Type :
    CREATE OR REPLACE
    TYPE MYTYPE AS OBJECT
    TxnId VARCHAR2(40),
    Target VARCHAR2(20),
    Source VARCHAR2(20),
    Param1 VARCHAR2(2048),
    Param2 VARCHAR2(2048),
    Param3 VARCHAR2(2048),
    Param4 VARCHAR2(2048),
    Param5 VARCHAR2(2048),
    and we have defined a collection of these as:
    CREATE OR REPLACE
    TYPE MYTYPE_COLLECTION AS VARRAY (100) OF MYTYPE
    There is a stored procedure which takes one of these collections as an input parameter and I need to invoke these from within my code.
    I am having major problems when I attempt to get the ArrayDescriptor etc to allow me to create an Array to pass to the stored procedure. I think this is because the underlying Oracle connection is wrapped by WebLogic.
    Has anyone managed to pass an array to an Oracle Stored procedure on a pooled DB connection?
    Thanks
    AndyHi. Here's what I suggest: First please get the JDBC you want to work in a
    small standalone program that uses the Oracle thin driver directly. Once
    that works, show me the JDBC code, and I will see what translation if
    any is needed to make it work with WLS. Will your code be running in
    WebLogic, or in an external client talking to WebLogic?
    Also, have you tried the executeBatch() methods to see if you can
    get the performance you want via batches?
    Joe

  • JDBC Receiver Adapter - Stored Procedure - Error Illegal Parameter

    Hi experts,
    I have a problem with the next scenario:
    HTTP <-> XI -> JDBC
    XI sends the following message to JDBC Adapter in mode Receiver to execute a Stored Procedure in a Informix database:
    <ns0:mt_messageTestSP xmlns:ns0="urn:test">
      <statement>
        <hastus_exporta_dia action="execute">
          <fechaEnvio isInput="true" type="DATE">11/17/2008</fechaEnvio>
        </hastus_exporta_dia>
      </statement>
    </ns0:mt_messageTestSP>
    Note: The format that accepts the SP Informix in the field of type date is: MM/dd/yyyy
    The SP is running on an Informix database, and the parameter (fechaEnvio) that receive the SP is of type DATE. At runtime the SP does not run, and in the Component Monitoring of the Runtime Workbench I see the following error:
    Unable to execute statement for table or stored procedure. 'hastus_exporta_dia' (Structure 'statement') due to java.lang.IllegalArgumentException
    Any idea?
    Thanks,
    Jose.

    Hi,
        Check the date format...once again...
    In oracle date format is DD/MM/YYYY but if the same is sent from PI its throwing the error....
    but when i send the format as DD-Mon-YYYY its accepting and showing as DD/MM/YYYY in oracle tables
    so just try fetching the date field from the informix database and see how it is get converted into..and based on that send the format
    HTH
    Rajesh

  • BI Publisher 11g - calling SQL Server 2005 stored procedure error

    Hi experts
    I have been calling succesfully an SQL server 2005 stored procedure for the data model of a BI publisher report in 10g, passing it a customerNo parameter.
    EXEC     [dbo].[usp_WelcomeLettersConsumerNo]
              @CustomerNo = :sCustomerNo
    However it does not work in 11g I get the error:
    [Hyperion][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'is'.
    which is frustrating as there is no 'is' in the statement (perhaps it is picking up :s?) - I wonder does anyone know if there has been a change in 11g that may be causing this?
    cheers
    Tim

    Hi experts
    I have been calling succesfully an SQL server 2005 stored procedure for the data model of a BI publisher report in 10g, passing it a customerNo parameter.
    EXEC     [dbo].[usp_WelcomeLettersConsumerNo]
              @CustomerNo = :sCustomerNo
    However it does not work in 11g I get the error:
    [Hyperion][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'is'.
    which is frustrating as there is no 'is' in the statement (perhaps it is picking up :s?) - I wonder does anyone know if there has been a change in 11g that may be causing this?
    cheers
    Tim

  • Problem with a stored procedure (Error(4,1): PLS-00428: an INTO clause..)

    Dear Oracle Experts,
    I try to use the stored procedure below but get this error :
    "Error(4,1): PLS-00428: an INTO clause is expected in this SELECT statement"
    I don't have any clue what could be wrong with my syntax. INTO wouldn't make any sense at this task.
    Does someone of you know what's wrong with my Procedure ?
    Hope someone can help,
    best regards,
    Daniel Wetzler
    create or replace PROCEDURE AnalysisCompatibility (DATEBEGIN timestamp, DATEEND timestamp)
    AS
    BEGIN
    select Fs.*,Vs.Analysispriority,Vs.Compatibility Compatibility from SigFacts Fs
    inner Join Variables Vs On
    (Fs.Var_Ref=Vs.Var_Ref and Fs.Machines_Ref=Vs.Machines_Ref )
    where Fs.DT between DATEBEGIN and DATEEND
    and
    Vs.AnalysisPriority > 0
    or
    VS.Compatibility in (6,7,8,9,10,11,13,21,22)
    order by Fs.DT,Fs.Machines_Ref desc, Vs.AnalysisPriority;
    END AnalysisCompatibility;

    I have created a table (ATREPORT.TEST) that has has got the same column name and type of the query output and i still get error message
    PLS-00403 -- statement ATreport.TESt cannot be used as an into target, pls help
    DECLARE start_date DATE := to_date('01/09/2006' , 'DD-MON-YYYY');
    end_date DATE := to_date('30/09/2006' , 'DD-MON-YYYY');
    BEGIN
    SELECT t.SEC_SHORT_NAME, t.SEC_ISIN, t.SEC_NO,t.SEC_NAME, t.TRADE_DATE,
    t.PAYMENT_DATE,t.COUNTERPARTY, t.PRICE , t.NOMINAL ,
                        t.TRANSACTION_NO,t.CURRENT_VALUE_PC, t.CURRENT_VALUE_SC, t.PAYMENT_AMOUNT_PC,
                        t.PAYMENT_AMOUNT_SC,
                   ct.AMOUNT , ct.CURRENCY,
              sb.BUSINESS_CLASS_LEVEL_2 ,sb.BUSINESS_CLASS_LEVEL_2_NAME,
              sb.BUSINESS_CLASS_LEVEL_3 ,sb.BUSINESS_CLASS_LEVEL_3_NAME,
              sb.BUSINESS_CLASS_LEVEL_4 ,sb.BUSINESS_CLASS_LEVEL_4_NAME,
    sb.BUSINESS_CLASS_LEVEL_5 ,sb.BUSINESS_CLASS_LEVEL_5_NAME
    INTO ATREPORT.TEST
    from scdat.A_TRANSACTIONS t
    INNER JOIN scdat.A_COSTTAX ct     
         ON ct.TRANS_REF = t.TRANS_REF
    INNER JOIN scdat.A_SECS_BUSINESS_CLASS_TS sb
    ON sb.SEC_REF = t.SEC_REF           
    where t.TRADE_DATE >= to_char(start_date ,'DD-MON-YYYY')
    and t.TRADE_DATE < to_char(end_date ,'DD-MON-YYYY')
    and ct.COST_NAME = 'Broker commission'
    and sb.BUSINESS_CLASS_DEFINITION = 'FTSE';
    END;

  • Stored Procedure error in Java

    My Java application is invoking stored procedure(Oracle 10g). The stored procedure is opening a cursor for a SQL query that is created dynamically in side the procedure. Whenever there is an error while opening the cursor (i.e. executing the SQL query), I get the following exception message in Java application logs irrespective of what error has caused during SQL execution.
    SQLException for SQL [{call PRC_TEST(?, ?, ?, ?, ?, ?, ?, ?)}]; SQL state [60000]; error code [604]; ORA-00604: error occurred at recursive SQL level 1
    ORA-01003: no statement parsed
    ; nested exception is java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
    ORA-01003: no statement parsed
    e.g. If the query is like select * from tableA and I dont have proper privlieges. I should get error message while opening the cursor :- insufficient privileges.
    Is there any way where we can get more precise(or exact!) error message (in Java application logs) that stopped SQL execution while opening the cursor?

    I'm using a callable statement.
    The strange thing is that, when i remove all IN and OUT paramters in the java code and the stored procedure, both the call to the stored procedure and teh execution of the stored procedure works.
    The moment I add in just a IN parameter (in the stored procedure, and setting it in the java code) it stops working, and i receive this error.
    java.sql.SQLException: ORA-06550: line 1, column 23:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    := . ( @ % ;
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
    heres the java code and stored procedure
    CREATE OR REPLACE PROCEDURE sampleProcedure(tax out number)
    is
    BEGIN
    tax := 10 *.15;
    /END;
    CallableStatement statement =conn.prepareCall("{call sampleprocedure ?}");
    statement.registerOutParameter(1,java.sql.Types.INTEGER);
    statement.execute();
    ResultSet rs = statement.getResultSet();
    if((rs = statement.getResultSet()) != null){

  • JDBC Stored Procedure error

    Hi All,
    Interface proxy to JDBC :
    In this I have used stored procedures and implemented structure accordingly.
    issue is while testing the interface its showing error for 1 field
    " Unable to execute statement for table or stored procedure. 'ABCD_SP' (Structure 'ABCD') due to java.sql.SQLException: Unsupported parameter type 'INT' for parameter 'VINSI' found "
    "JDBC message processing failed; reason Error processing request in sax parser: Error when executing statement for table/stored proc. 'ABCD_SP' (structure 'ABCD'): java.sql.SQLException: Unsupported parameter type 'INT' for parameter 'VINSI' found "
    I have communicated with DB team and they are saying that field ABCD is "INT" type only . In the same way in my message mapping also i have given INT for Type attribute .
    Please help what is the root cause .
    Vin

    Hi,
    i think you defined Parameter type as "INT" and the value is coming in CHAR formate.
    If Parameter type as "INT" then value should be some number and not Charectors
    If Parameter type as "CHAR" then value should be some Charecters and not NUM.
    Regards,
    Mastan

Maybe you are looking for

  • Using a precondition strict to a specified Class

    Dear All:                Now I have a class X , the class has two characteristics A and B ,  A has values a1 and a2 , B has values b1 and b2 . In the configration , when I choose a1 for A then b2 cannot be chosen . To fulfill that I can creat a preco

  • Mixed encoding in soap message reply

    I am trying to send a soap message to a service that uses UTF-16 encoding. I sent a UTF-8 encoded request. The reply was UTF-8 but the body was UTF-16. <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.o

  • Why can't i sign in app store

    Hi i cannot log in to Apple  store and i could open my account but not in the app store i could pruchase from itunes but not from app store.

  • Streaming from PC to TV wirelessly.

    I just saw a commercial showing the blue labels and toshiba laptops and they were showing that they could stream from the laptop to the tv wirelessly.  You could show videos or do slideshows, etc..  How do I do that? Thanks, J

  • HT4060 My iPad 2 is taking forever to charge. What is happening?

    My iPad 2 is charging slowly. Why is that?