CastCastException with OracleCallableStatement

I'm trying to use Oracle JDBC extensions with the Oracle thin Driver (to
read a cursor returned by a PL/SQL function). When I attempt to cast a
CallableStatement to an weblogic.jdbc.vendor.oracle.OracleCallableStatement,
the weblogic wrapper class, I still get the same ClassCastException as if I
try to cast to a vanilla OracleCallableStatement. I thought the weblogic
class was the fix to this problem.
Code is:
ResultSet rs =
((weblogic.jdbc.vendor.oracle.OracleCallableStatement)cs).getCursor(1);
Exception is:
java.sql.SQLException: java.lang.ClassCastException:
oracle.jdbc.driver.OracleCallableStatement
It's interesting that the exception is for
oracle.jdbc.driver.CallableStatement, even though I'm casting to the
Weblogic wrapper class.
Weblogic version is 6.1 sp2
Oracle is 8.1.6
Does anyone know what's happeneng here, and how to fix it.
Any help much appreciated
John

Unfortunatly, this doesn't work either - it doesn't understand the new type:
java.sql.SQLException: Invalid column type
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)
at
oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:53
40)
at
oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallab
leStatement.java:245)
at
oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallab
leStatement.java:370)
at
weblogic.jdbc.jts.Statement.registerOutParameter(Statement.java:973)
at
weblogic.jdbc.rmi.internal.CallableStatementImpl.registerOutParameter(Callab
leStatementImpl.java:53)
at
weblogic.jdbc.rmi.SerialCallableStatement.registerOutParameter(SerialCallabl
eStatement.java:48)
at com.bluedot.beans.support.ProcedureBuffer.executeFunction(Unknown
Source)
at
com.bluedot.beans.support.ProcedureBuffer.executeTagSetFunction(Unknown
Source)
at
com.bluedot.beans.entityManagement.EntityManagementServerBean.getExhibitorSt
ats(Unknown Source)
at
com.bluedot.beans.entityManagement.EntityManagementServerBean_7yjcm7_EOImpl.
getExhibitorStats(EntityManagemen
tServerBean_7yjcm7_EOImpl.java:37)
etc
"Slava Imeshev" <[email protected]> wrote in message
news:[email protected]...
OK. Now it's clear. You can not use OracleTypes.CURSOR.
In order to get a result set from cursor, the right sequence
should be following:
cs.registerOutParameter(1, java.sql.Types.OTHER);
cs.execute();
ResultSet rs = cstmt.getResultSet(1);
Regards,
Slava Imeshev
"John Prout" <[email protected]> wrote in message
news:[email protected]...
Slava
Here's part of the stack trace - the whole thing is probably 100 lines:
java.sql.SQLException: java.lang.ClassCastException:
oracle.jdbc.driver.OracleCallableStatement
at
weblogic.jdbc.jts.CallableStatement.getCursor(CallableStatement.java:277)
at
weblogic.jdbc.rmi.internal.CallableStatementImpl.getCursor(CallableStatement
Impl.java:420)
at
weblogic.jdbc.rmi.SerialCallableStatement.getCursor(SerialCallableStatement.
java:496)
at
com.bluedot.beans.support.ProcedureBuffer.executeTagSetFunction(Unknown
Source)
at
com.bluedot.beans.entityManagement.EntityManagementServerBean.getExhibitorSt
ats(Unknown Source)
at
com.bluedot.beans.entityManagement.EntityManagementServerBean_7yjcm7_EOImpl.
getExhibitorStats(EntityManagemen
tServerBean_7yjcm7_EOImpl.java:421)
at
com.bluedot.beans.entityManagement.EntityManagementServerBean_7yjcm7_EOImpl_
WLSkel.invoke(Unknown Source)
at
weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:296)
As you can see, the PL/SQL code is being called from an EJB.
The connection is obtained through JNDI:
java.sql.Connection conn = null;
Hashtable ht = new Hashtable() ;
ht.put( Context.INITIAL_CONTEXT_FACTORY ,
"weblogic.jndi.WLInitialContextFactory" );
InitialContext ctx = new InitialContext( ht ) ;
if ( ctx == null ) return null ;
String dataSource = getUserSession().getDatabase() ;
javax.sql.DataSource source = (javax.sql.DataSource) ctx.lookup(
dataSource ) ;
if ( source != null )
conn = source.getConnection() ;
Then the CallableStatement is obtained and used:
OracleConnection con = null ;
OracleCallableStatement cs = null ;
Object returnValue = null;
ResultSet rs = null ;
// String in the form: { ? = call <procedure-name>[<arg1>,<arg2>,...]}
StringBuffer buff = new StringBuffer();
buff.append("{ ? = call ").append(functionName).append("()") ;
// setup mStringBuffer and mStringLength so the rest of the class will
work right
buff.getChars(0, buff.length(),mStringBuffer,0);
mStringLength = buff.length();
con = (OracleConnection)psc.getDatabaseConnection() ;
cs = (OracleCallableStatement)con.prepareCall( buff.toString() ) ;
cs.registerOutParameter(1, OracleTypes.CURSOR);
// printQuery( psc ) ;
boolean result = cs.execute() ; // It's not in the API what "result"
is...
rs =
((weblogic.jdbc.vendor.oracle.OracleCallableStatement)cs).getCursor(1);
The exception happens when I call getCursor(1)
This code works outside weblogic, using a connection I obtain usingstandard
JDBC and the Oracle thin driver.
The sample is extracted from several pieces of the real code, so therecould
be compile errors, etc
John
"Slava Imeshev" <[email protected]> wrote in message
news:[email protected]...
Hi John,
Could you post the questionable code and the full exception?
From information provided it's not clear whether this exception
is thown from the server or from the app.
Regards,
Slava Imeshev
"John Prout" <[email protected]> wrote in message
news:[email protected]...
I am getting a connection from a standard weblogic connection pool,
using
a
JNDI lookup. I can see no way to directly obtain a
weblogic.jdbc.vendor.oracle.OracleConnection. If I cast everything to
the
weblogic OracleConnection and OracleCallableStatement, I still get thesame
ClassCastException
Can you post an example of how to get the
weblogic.jdbc.vendor.oracle.OracleConnection
Thanks
John
"Slava Imeshev" <[email protected]> wrote in message
news:[email protected]...
Hi John,
This exception is thrown because plain oracle connection was used.
To use weblogic oracle extensions, connection should be obtained
from the connection pool, either via DataSource or directly.
Regards,
Slava Imeshev
"John Prout" <[email protected]> wrote in message
news:[email protected]...
I'm trying to use Oracle JDBC extensions with the Oracle thin Driver
(to
read a cursor returned by a PL/SQL function). When I attempt to cast a
CallableStatement to anweblogic.jdbc.vendor.oracle.OracleCallableStatement,
the weblogic wrapper class, I still get the same ClassCastException as
if
I
try to cast to a vanilla OracleCallableStatement. I thought the
weblogic
class was the fix to this problem.
Code is:
ResultSet rs =
((weblogic.jdbc.vendor.oracle.OracleCallableStatement)cs).getCursor(1);
>>>
Exception is:
java.sql.SQLException: java.lang.ClassCastException:
oracle.jdbc.driver.OracleCallableStatement
It's interesting that the exception is for
oracle.jdbc.driver.CallableStatement, even though I'm casting to the
Weblogic wrapper class.
Weblogic version is 6.1 sp2
Oracle is 8.1.6
Does anyone know what's happeneng here, and how to fix it.
Any help much appreciated
John

Similar Messages

  • Trouble with OracleCallableStatement - Ignore previous

    Hi . . .
    I am receiving the following exception: wrong number or types of arguments in call to 'FUNCTION_A'
    Here are defined types:
    create or replace TYPE NET_CHARTS_CHAR_ARRAY AS VARRAY(3) OF CHAR(10);
    create or replace TYPE NET_CHARTS_NUMBER_ARRAY AS VARRAY(3) OF NUMBER;
    Here is FUNCTION_A:
    TYPE array_number IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    FUNCTION dial_chart_def(
    field_a IN OUT ARRAY,
    field_b IN ARRAY,
    field_c IN OUT array_number,
    field_d IN NUMBER, --unit is inches
    field_e IN NUMBER, --unit is inches
    field_f IN VARCHAR2,
    field_g IN NUMBER DEFAULT cDefaultDPI,
    field_h IN NUMBER DEFAULT cDefaultfontScale)
    RETURN VARCHAR2;
    Here is my Java code:
    OracleCallableStatement proc = (OracleCallableStatement)
    conn.prepareCall("{ ? = call net_charts.function_a(?,?,?,?,?,?,?,?) }");
    proc.registerOutParameter(1, Types.VARCHAR);
    ArrayDescriptor arrayDescVarchar = ArrayDescriptor.createDescriptor("NET_CHARTS_CHAR_ARRAY", conn);
    ArrayDescriptor arrayDescDouble = ArrayDescriptor.createDescriptor("NET_CHARTS_NUMBER_ARRAY", conn);
    ARRAY labels = new ARRAY(arrayDescVarchar, conn, aLabels);
    ARRAY colors = new ARRAY(arrayDescVarchar, conn, aColors);
    ARRAY values = new ARRAY(arrayDescDouble, conn, aValues);
    proc.setARRAY(2, labels);
    proc.registerOutParameter(2, Types.ARRAY);
    proc.setARRAY(3, colors);
    proc.setARRAY(4, values);
    proc.registerOutParameter(4, Types.ARRAY);
    proc.setInt(5, 4);
    proc.setInt(6, 2);
    proc.setString(7, "aString");
    proc.setInt(8, 300);
    proc.setDouble(9, (300/72));
    proc.execute();
    String value = proc.getString(1);
    proc.close();
    return value;
    Any ideas?
    Can I use NET_CHARTS_NUMBER_ARRAY in place of "array_number" is the type for parameter 4? My code cannot locate "array_number" on the database for some reason.

    Sorry . . .
    PLease use :
    FUNCTION function_a(
    field_a IN OUT ARRAY,
    field_b IN ARRAY,
    field_c IN OUT array_number,
    field_d IN NUMBER, --unit is inches
    field_e IN NUMBER, --unit is inches
    field_f IN VARCHAR2,
    field_g IN NUMBER DEFAULT cDefaultDPI,
    field_h IN NUMBER DEFAULT cDefaultfontScale)
    RETURN VARCHAR2;

  • ClassCastException with OracleCallableStatement

    Hi,
    I am porting our application from WLS6.0 sp2 to WLS6.1 and have encountered the
    above error. As far as I can see, nothing in our code has changed (I just rebuilt
    against the WLS6.1 libraries and deployed to the new server)
    Thanks for any help.
    Gino
    Stack trace below :
    java.sql.SQLException: java.lang.ClassCastException: oracle.jdbc.driver.OracleCallableStatement
    at weblogic.jdbc.jts.CallableStatement.clearParameters(CallableStatement.java:220)
    at weblogic.jdbc.rmi.internal.CallableStatementImpl.clearParameters(CallableStatementImpl.java:368)
    at weblogic.jdbc.rmi.SerialCallableStatement.clearParameters(SerialCallableStatement.java:444)
    at com.banctec.caseware.server.dbaccess.dao.helper.DaoParameterHelper.bindToStatement(DaoParameterHelper.java:977)
    at com.banctec.caseware.server.dbaccess.dao.helper.DaoParameterHelper.bindToStatement(DaoParameterHelper.java:1170)
    at com.banctec.caseware.server.dbaccess.dao.CaseDAOOracle.insertRow(CaseDAOOracle.java:126)
    at com.banctec.caseware.server.dbaccess.dao.CaseDAO.insert(CaseDAO.java:190)
    at com.banctec.caseware.server.dbaccess.DBAccessBean.insert(DBAccessBean.java:243)
    at com.banctec.caseware.server.dbaccess.DBAccessBean_m9wwam_EOImpl.insert(DBAccessBean_m9wwam_EOImpl.java:389)
    at com.banctec.caseware.server.casehandler.CaseHandlerBean.createResource(CaseHandlerBean.java:1286)
    at com.banctec.caseware.server.casehandler.CaseHandlerBean_nn9cfa_EOImpl.createResource(CaseHandlerBean_nn9cfa_EOImpl.java:475)
    at com.banctec.caseware.server.cpc.CPCBean.createResource(CPCBean.java:682)
    at com.banctec.caseware.server.cpc.CPCBean_1fna_EOImpl.createResource(CPCBean_1fna_EOImpl.java:387)
    at com.banctec.caseware.server.cpc.CPCBean_1fna_EOImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:257)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    http://e-docs.bea.com/wls/docs60/notes/issues.html#1024261
    Oracle offers several non-standard (not approved by Sun) extensions to JDBC:
    OracleConnection
    OracleStatement
    OracleResultSet
    OraclePreparedStatement
    OracleCallableStatement
    If a user attempts to use these classes within an application that gets its
    connection using WebLogic Server JDBC, they will not work.
    "Gino Coccia" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hi,
    I am porting our application from WLS6.0 sp2 to WLS6.1 and haveencountered the
    above error. As far as I can see, nothing in our code has changed (I justrebuilt
    against the WLS6.1 libraries and deployed to the new server)
    Thanks for any help.
    Gino
    Stack trace below :
    java.sql.SQLException: java.lang.ClassCastException:oracle.jdbc.driver.OracleCallableStatement
    atweblogic.jdbc.jts.CallableStatement.clearParameters(CallableStatement.java:2
    20)
    atweblogic.jdbc.rmi.internal.CallableStatementImpl.clearParameters(CallableSta
    tementImpl.java:368)
    atweblogic.jdbc.rmi.SerialCallableStatement.clearParameters(SerialCallableStat
    ement.java:444)
    atcom.banctec.caseware.server.dbaccess.dao.helper.DaoParameterHelper.bindToSta
    tement(DaoParameterHelper.java:977)
    atcom.banctec.caseware.server.dbaccess.dao.helper.DaoParameterHelper.bindToSta
    tement(DaoParameterHelper.java:1170)
    atcom.banctec.caseware.server.dbaccess.dao.CaseDAOOracle.insertRow(CaseDAOOrac
    le.java:126)
    atcom.banctec.caseware.server.dbaccess.dao.CaseDAO.insert(CaseDAO.java:190)
    atcom.banctec.caseware.server.dbaccess.DBAccessBean.insert(DBAccessBean.java:2
    43)
    atcom.banctec.caseware.server.dbaccess.DBAccessBean_m9wwam_EOImpl.insert(DBAcc
    essBean_m9wwam_EOImpl.java:389)
    atcom.banctec.caseware.server.casehandler.CaseHandlerBean.createResource(CaseH
    andlerBean.java:1286)
    atcom.banctec.caseware.server.casehandler.CaseHandlerBean_nn9cfa_EOImpl.create
    Resource(CaseHandlerBean_nn9cfa_EOImpl.java:475)
    atcom.banctec.caseware.server.cpc.CPCBean.createResource(CPCBean.java:682)
    atcom.banctec.caseware.server.cpc.CPCBean_1fna_EOImpl.createResource(CPCBean_1
    fna_EOImpl.java:387)
    atcom.banctec.caseware.server.cpc.CPCBean_1fna_EOImpl_WLSkel.invoke(Unknown
    Source)
    atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
    atweblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :93)
    atweblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:257)
    atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
    2)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

  • CLassCastException with oracle.jdbc.driver.OracleCallableStatement

    Hello,
    I get a ClassCastException when I try to execute a Stored Procedure with WL6.1
    and the JDriver.
    I have a servlet who intanciate a Bean and call to his execute() method in this
    way:
    Context ctx = null;
    Hashtable ht = new Hashtable();
    Connection conn = null;
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    try {
    ctx = new InitialContext(ht);
    javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(connPool);
    conn = ds.getConnection();
    conn.setAutoCommit(true);
    SvcEmpEstObt empEstObt = new SvcEmpEstObt();
    empEstObt.setMaxRows(100);
    empEstObt.setConnection(conn);
    //Get parameters from Http Get and set the JB
    empEstObt.setEmpRut(request.getParameter("rut"));
    empEstObt.setEmpTimeStamp(request.getParameter("timestamp"));
    //Execute Service
    empEstObt.execute();
    /* ********* the execute() method of the jb is listed here */
    public int execute() throws ClassNotFoundException, SQLException{
    intreturnedRows = 0;
    try {if (connection == null){
    try {Class.forName(driver);
    } catch (ClassNotFoundException e) {
    System.err.println("ClassNotFoundException: " + e);
    throw e;
    connection = DriverManager.getConnection(url, user, password);
    row = -1;
    srv_message = String.valueOf(maxRows);
    String sp = "{call SvcEmpEstObt_Pkg.SvcEmpEstObt(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}";
    oracle.jdbc.driver.OracleCallableStatement procout = (oracle.jdbc.driver.OracleCallableStatement)
    connection.prepareCall(sp); // The exception is here
    procout.registerOutParameter(1, Types.VARCHAR);
    procout.setString(1, srv_message);
    procout.setString(2, empRut);
    procout.setString(3, empTimeStamp);
    procout.registerOutParameter(4, Types.VARCHAR);
    procout.registerOutParameter(5, Types.VARCHAR);
    procout.registerOutParameter(6, Types.INTEGER);
    int elemSqlType = OracleTypes.INTEGER;
    int elemMaxLen = 0;
    procout.registerIndexTableOutParameter(7, maxRows, elemSqlType, elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 30;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(8, maxRows, elemSqlType, elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 21;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(9, maxRows, elemSqlType, elemMaxLen);
    elemSqlType = OracleTypes.INTEGER;
    elemMaxLen = 0;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(10, maxRows, elemSqlType, elemMaxLen);
    // execute the call
    procout.execute();
    sqlWarning = procout.getWarnings();
    srv_message = procout.getString(1);
    returnStatus = new Integer(srv_message.substring(0,1)).intValue();
    dagMessage = new DagMessage();
    dagMessage.oracleMessage(srv_message);
    // access the value using JDBC default mapping
    empEstTitulo = procout.getString(4);
    empEstUniv = procout.getString(5);
    empEstNivel = procout.getInt(6);
    curCodigo = (BigDecimal[]) procout.getPlsqlIndexTable(7);
    curNombre = (String[]) procout.getPlsqlIndexTable(8);
    curFecha = (String[]) procout.getPlsqlIndexTable(9);
    curDuracion = (BigDecimal[]) procout.getPlsqlIndexTable(10);
    // close the statement
    procout.close();
    if (curCodigo == null) {
    return 0;
    } else {
    return curCodigo.length;
    } catch (SQLException e) {
    SQLException ex = e;
    System.err.println("\n--- SQLException caught ---\n");
    while (ex != null) {
    System.err.println("Message: " + ex.getMessage ());
    System.err.println("SQLState: " + ex.getSQLState ());
    System.err.println("ErrorCode: " + ex.getErrorCode ());
    ex = ex.getNextException();
    System.out.println("");
    throw e;
    Does Someone has an idea why it happens ?

    Hans,
    Could you give us the whole text of exception?
    Regards,
    Slava Imeshev
    "Hans" <[email protected]> wrote in message
    news:[email protected]...
    >
    It Works! Thanx a lot ....
    I was working with a previous version of my App ... I fixed the problemand now
    i can Cast to weblogic.jdbc.vendor.oracle.OracleCallableStatement,
    But ...
    I get the following Exception:
    SQL Exception:
    registerIndexTableOutParameter is not supported by the
    underlying JDBC driver weblogic.jdbc.pool.Connection
    What I need to do ?
    /* this is what i`m trying to make */
    weblogic.jdbc.vendor.oracle.OracleCallableStatement procout =(weblogic.jdbc.vendor.oracle.OracleCallableStatement)
    connection.prepareCall(sp);
    procout.registerOutParameter(1, Types.VARCHAR);
    procout.setString(1, srv_message);
    procout.setString(2, empRut);
    procout.setString(3, empTimeStamp);
    procout.registerOutParameter(4, Types.VARCHAR);
    procout.registerOutParameter(5, Types.VARCHAR);
    procout.registerOutParameter(6, Types.INTEGER);
    int elemSqlType = OracleTypes.INTEGER;
    int elemMaxLen = 0;
    procout.registerIndexTableOutParameter(7, maxRows, elemSqlType,elemMaxLen);
    >
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 30;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(8, maxRows, elemSqlType,elemMaxLen);
    >
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 21;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(9, maxRows, elemSqlType,elemMaxLen);
    >
    elemSqlType = OracleTypes.INTEGER;
    elemMaxLen = 0;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(10, maxRows, elemSqlType,elemMaxLen);
    >
    >
    "Hans" <[email protected]> wrote:
    Thanx Slava,
    But I have the same problem again...
    I replace oracle.jdbc.driver.OracleCallableStatement with
    weblogic.jdbc.vendor.oracle.OracleCallableStatement
    and I get the same ClassClastException in
    weblogic.jdbc.vendor.oracle.OracleCallableStatement procout =
    (weblogic.jdbc.vendor.oracle.OracleCallableStatement)
    connection.prepareCall(sp);
    Any ideas ??
    "Slava Imeshev" <[email protected]> wrote:
    Hi Hans,
    You can not cast returned object to
    oracle.jdbc.driver.OracleCallableStatement
    when accessing oracle db via connection pool.
    It can be casted to weblogic.jdbc.vendor.oracle.OracleCallableStatement.
    Here is a list of methods supported by this interface:
    void clearParameters() throws java.sql.SQLException;
    void registerIndexTableOutParameter(int i, int j, int k, int l) throws
    java.sql.SQLException;
    void registerOutParameter(int i, int j, int k, int l) throws
    java.sql.SQLException;
    java.sql.ResultSet getCursor(int i) throws java.sql.SQLException;
    java.io.InputStream getAsciiStream(int i) throws
    java.sql.SQLException;
    java.io.InputStream getBinaryStream(int i) throwsjava.sql.SQLException;
    java.io.InputStream getUnicodeStream(int i) throwsjava.sql.SQLException;
    >>>
    Regards,
    Slava Imeshev
    "Hans" <[email protected]> wrote in message
    news:[email protected]...
    Hello,
    I get a ClassCastException when I try to execute a Stored Procedurewith
    WL6.1
    and the JDriver.
    I have a servlet who intanciate a Bean and call to his execute()
    method
    in
    this
    way:
    Context ctx = null;
    Hashtable ht = new Hashtable();
    Connection conn = null;
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFact
    or
    y");
    try {
    ctx = new InitialContext(ht);
    javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(connPool);
    conn = ds.getConnection();
    conn.setAutoCommit(true);
    SvcEmpEstObt empEstObt = new SvcEmpEstObt();
    empEstObt.setMaxRows(100);
    empEstObt.setConnection(conn);
    file://Get parameters from Http Get and set the JB
    empEstObt.setEmpRut(request.getParameter("rut"));
    empEstObt.setEmpTimeStamp(request.getParameter("timestamp"));
    file://Execute Service
    empEstObt.execute();
    /* ********* the execute() method of the jb is listed here */
    public int execute() throws ClassNotFoundException, SQLException{
    intreturnedRows = 0;
    try {if (connection == null){
    try {Class.forName(driver);
    } catch (ClassNotFoundException e) {
    System.err.println("ClassNotFoundException: " + e);
    throw e;
    connection = DriverManager.getConnection(url, user, password);
    row = -1;
    srv_message = String.valueOf(maxRows);
    String sp = "{call SvcEmpEstObt_Pkg.SvcEmpEstObt(?, ?, ?, ?, ?, ?,?, ?,
    oracle.jdbc.driver.OracleCallableStatement procout =(oracle.jdbc.driver.OracleCallableStatement)
    connection.prepareCall(sp); // The exception is here
    procout.registerOutParameter(1, Types.VARCHAR);
    procout.setString(1, srv_message);
    procout.setString(2, empRut);
    procout.setString(3, empTimeStamp);
    procout.registerOutParameter(4, Types.VARCHAR);
    procout.registerOutParameter(5, Types.VARCHAR);
    procout.registerOutParameter(6, Types.INTEGER);
    int elemSqlType = OracleTypes.INTEGER;
    int elemMaxLen = 0;
    procout.registerIndexTableOutParameter(7, maxRows, elemSqlType,elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 30;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(8, maxRows, elemSqlType,elemMaxLen);
    elemSqlType = OracleTypes.VARCHAR;
    elemMaxLen = 21;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(9, maxRows, elemSqlType,elemMaxLen);
    elemSqlType = OracleTypes.INTEGER;
    elemMaxLen = 0;
    // register the OUT parameter
    procout.registerIndexTableOutParameter(10, maxRows, elemSqlType,elemMaxLen);
    // execute the call
    procout.execute();
    sqlWarning = procout.getWarnings();
    srv_message = procout.getString(1);
    returnStatus = new Integer(srv_message.substring(0,1)).intValue();
    dagMessage = new DagMessage();
    dagMessage.oracleMessage(srv_message);
    // access the value using JDBC default mapping
    empEstTitulo = procout.getString(4);
    empEstUniv = procout.getString(5);
    empEstNivel = procout.getInt(6);
    curCodigo = (BigDecimal[]) procout.getPlsqlIndexTable(7);
    curNombre = (String[]) procout.getPlsqlIndexTable(8);
    curFecha = (String[]) procout.getPlsqlIndexTable(9);
    curDuracion = (BigDecimal[]) procout.getPlsqlIndexTable(10);
    // close the statement
    procout.close();
    if (curCodigo == null) {
    return 0;
    } else {
    return curCodigo.length;
    } catch (SQLException e) {
    SQLException ex = e;
    System.err.println("\n--- SQLException caught ---\n");
    while (ex != null) {
    System.err.println("Message: " + ex.getMessage ());
    System.err.println("SQLState: " + ex.getSQLState ());
    System.err.println("ErrorCode: " + ex.getErrorCode ());
    ex = ex.getNextException();
    System.out.println("");
    throw e;
    Does Someone has an idea why it happens ?

  • IndexBy table param in OracleCallableStatement creates 4MB byte[] with junk

    We have facing OutOfMemory error and the memory dump points to huge memory heap in a particular CallableStatement. One of the parameter to the CallableStatment is a index-by table and this is creating a 4MB byte array and holding on to it.
    This is our call:
    ocStmt.setPlsqlIndexTable(bindIndex[0],
    translationData,
    500,
    translationData.length,
    OracleTypes.VARCHAR,
    2000);
    translationData is a declared as "String[] translationData". When I print out the translationData.length, it comes as 40. In the memory dump, there is a byte[] parameter to this CallableStatment whose size is 4 MB and if I check the contents of it, the initial staring part is what we pass and rest is all nothing/junk.
    One thing to note is that some of the elements in the translationData string array is null.
    We also close this staement in the finally block. Do we need to do anything else, to remove this foot print from the memory?
    OracleCallableStatement ocStmt = null;
    try
    // Prepare the statement and call the loader procedure
    ocStmt = (OracleCallableStatement)mConn.prepareCall(sCreateTaskTranslations);
    int[] bindIndex = new int[] { 1 };
    Util.setStringValue(ocStmt,taskId,bindIndex);
    Util.setIntValue(ocStmt,version,bindIndex);
    ocStmt.setPlsqlIndexTable(bindIndex[0],
    translationData,
    500,
    translationData.length,
    OracleTypes.VARCHAR,
    2000);
    bindIndex[0]++;
    //setInt method interprets a value of 0 as null
    //call setIntNotNullValue to allow a value of 0 to be passed.
    Util.setIntNotNullValue(ocStmt,rec_size,bindIndex);
    Util.setBooleanValue(ocStmt,isVersionable,bindIndex);
    ocStmt.executeUpdate();
    catch(Exception e)
    // Throw this Exception
    finally
    Util.closePreparedStatement(ocStmt);
    Any pointers on why it is ending up with such a huge byte array? and how to avoid it?
    Edited by: user641043 on Mar 23, 2010 12:33 PM

    Hi,
    I think you will be better of posting your question in call interface forum.
    Oracle Call Interface (OCI)
    Regards

  • Issue in Invoking an Updatable View with Instead of Trigger

    Hi,
    I am trying to insert a record using Updatable View with Instead of Trigger. When i try to save the data, i get the below error:
    java.sql.SQLException: ORA-01403: no data found
    ORA-06512: at line 1
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:213)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1075)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1466)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3887)
    at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:9323)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1508)
    at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:172)
    at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:432)
    at oracle.jbo.server.EntityImpl.doDMLWithLOBs(EntityImpl.java:8566)
    Can someone help me resolve this issue?
    Also it would be great if you can share Sample codes for Invoking an updatable view with instead of trigger on Save/commit.
    Regards,
    Jeevan

    As a trigger is executed in the db and not in your app it's really hard to help as you did not give any useful information.
    Have you read this blog http://stegemanoracle.blogspot.com/2006/03/using-updatable-views-with-adf.html ?
    Timo
    Edited by: Timo Hahn on 22.09.2011 09:15
    And my friend google also found http://technology.amis.nl/blog/1447/adf-business-components-resfresh-after-insertupdate-and-instead-of-triggers

  • With JDBC, calling a stored procedure with ARRAY as out parameter

    Hi,
    I want to use the data type ARRAY as an out parameter in an Oracle stored procedure. I want to call the stored procedure from
    my java program using JDBC.
    The problem it's i use a 8.1.7 client to acces with oci to a 7.1.3 Database.
    With this configuration I can get back a Cursor but not an Array.
    Does it's possible ?
    Thanks for your help !
    Michakl

    Originally posted by JDBC Development Team:
    It's very similar to other datatype except that it uses OracleTypes.ARRAY typecode and the value is mapped to a oracle.sql.ARRAY instance. The code looks as follows --
    cstmt.registerOutParameter (idx, OracleTypes.ARRAY, "VARRAY_TYPE_NAME_HERE");
    cstmt.execute ();
    ARRAY array = (ARRAY) cstmt.getObject (idx);
    Thanks for your reply.
    I have to use:-
    OracleCallableStatement cs1 = (OracleCallableStatement )conn.prepareCall
    ( "{call proj_array(?)}" ) ;
    for retrieving a collection as an OUT parameter.
    This gives me the errors:-
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Blob getBlob(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Array getArray(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Clob getClob(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Ref getRef(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    How do I get rid of these errors?
    null

  • Cursor bound to out parameter with Connection Pool

    Is it possible to retrieve a cursor bound to an out parameter when using the thin
    driver to establish the connection pool to the database? I am currently using
    the JDriver to connect create the pool and the pool driver to connect from the
    app to the connection pool. We'd like to avoid using the Oracle client if possible.
    Currently I register the out parameter as java.sql.Types.OTHER, then call getResultSet(1)
    on the weblogic.jdbc.pool.CallableStatement object. But it breaks when I change
    the connection pool to use the thin driver. The error is at the bottom of this
    post.
    I think I could possibly get the current pool driver to work if can find some
    documentation on these two methods:
    void registerOutParameter(int i, int j, int k, int l)
    void registerOutParameter(int i, int sqlType, java.lang.String typeName)
    I have no idea what to put in for the ints in the first method or for sqlType
    or typeName. Can anyone point me to where I can find this documentation?
    E-docs mentions this class: weblogic.jdbc.vendor.oracle.OracleCallableStatement.
    (http://edocs.bea.com/wls/docs61/jdbc/thirdparty.html#1023867). Should I consider
    this? If so where is it?
    Thanks a lot,
    Matt Savino
    <<< error when using thin driver >>>
    preparing callable stmt
    callable stmt prepared, java.sql.Types.OTHER = 1111
    java.sql.SQLException: Invalid column type
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
    at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
    at weblogic.jdbc.pool.Statement.registerOutParameter(Statement.java:617)
    at jsp_servlet._reportmanager.__thin_outputresultset._jspService(__thin_outputresultset.java:145)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    Thanks Joe, your answer pointed me in the right direction. Just in case anyone
    wants to know, the solution took two changes:
    CHANGE
    cStat.registerOutParameter(1, java.sql.Types.OTHER);
    TO
    cStat.registerOutParameter(1, oracle.jdbc.driver.OracleTypes.CURSOR);
    (cStat is an instance of weblogic.jdbc.pool.CallableStatement)
    AND
    rs = cStat.getResultSet(1);
    TO
    rs = cStat.getCursor(1);
    Thanks again,
    Matt
    Joseph Weinstein <[email protected]> wrote:
    Hi Matt.
    Look at the Oracle thin driver documentation to determine what type you
    should define in the registerOutParameter call. We use 'OTHER', but
    their driver may use something else for CURSOR output parameters.
    joe
    Matt Savino wrote:
    Is it possible to retrieve a cursor bound to an out parameter whenusing the thin
    driver to establish the connection pool to the database? I am currentlyusing
    the JDriver to connect create the pool and the pool driver to connectfrom the
    app to the connection pool. We'd like to avoid using the Oracle clientif possible.
    Currently I register the out parameter as java.sql.Types.OTHER, thencall getResultSet(1)
    on the weblogic.jdbc.pool.CallableStatement object. But it breaks whenI change
    the connection pool to use the thin driver. The error is at the bottomof this
    post.
    I think I could possibly get the current pool driver to work if canfind some
    documentation on these two methods:
    void registerOutParameter(int i, int j, int k, int l)
    void registerOutParameter(int i, int sqlType, java.lang.String typeName)
    I have no idea what to put in for the ints in the first method or forsqlType
    or typeName. Can anyone point me to where I can find this documentation?
    E-docs mentions this class: weblogic.jdbc.vendor.oracle.OracleCallableStatement.
    (http://edocs.bea.com/wls/docs61/jdbc/thirdparty.html#1023867). Should
    I consider
    this? If so where is it?
    Thanks a lot,
    Matt Savino
    <<< error when using thin driver >>>
    preparing callable stmt
    callable stmt prepared, java.sql.Types.OTHER = 1111
    java.sql.SQLException: Invalid column type
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
    at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
    at weblogic.jdbc.pool.Statement.registerOutParameter(Statement.java:617)
    at jsp_servlet._reportmanager.__thin_outputresultset._jspService(__thin_outputresultset.java:145)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    PS: Folks: BEA WebLogic is expanding rapidly, with both entry and advanced
    positions
    for people who want to work with Java, XML, SOAP and E-Commerce infrastructure
    products.
    We have jobs at Nashua NH, Liberty Corner NJ, San Francisco and San Jose
    CA.
    Send resumes to [email protected]

  • Problem with store ResultSet and show result in table

    Hi, I'm kind of new in ADF, I need to store ResultSet and show result in table-component. I have two problems:
    1) I get my ResultSet by calling callStoredProcedure(...) and this returns actually ref_cursor as ResultSet.
    When I try to println() contains of this result set in this method - it works OK (commented part),
    but when I want to println() somewhere else (eg. in retrieveRefCursor() method) it doesn't work.
    The problem is that the scrollability of the ResultSet is lost - it becomes a TYPE_FORWARD_ONLY ResultSet.
    Is there any way to store data from ref_cursor for a long time?
    2) My second problem is "store any result set and show this data in table". I have tried use method storeNewResultSet() but
    without result (table contains only "No rows yet" and everything seems to be OK - no exception, no warning, no error...).
    I have tried to call this method with ResultSet from select on dbs (without resultSet as ref_cursor ) - no result with createRowFromResultSet(),
    storeNewResultSet(), setUserDataForCollection()...
    I've tried a lot of ways to do this, but it doesn't work. I really don't know how to make it so it can work.
    Thanks for your help.
    ADF BC, JDev 11.1.1.0
    This is my code from ViewObjectImpl
    package tp.model ;
    import com.sun.jmx.mbeanserver.MetaData ;
    import java.sql.CallableStatement ;
    import java.sql.Connection ;
    import java.sql.PreparedStatement ;
    import java.sql.ResultSet ;
    import java.sql.ResultSetMetaData ;
    import java.sql.SQLException ;
    import java.sql.Statement ;
    import java.sql.Types ;
    import oracle.jbo.JboException ;
    import oracle.jbo.server.SQLBuilder ;
    import oracle.jbo.server.ViewObjectImpl ;
    import oracle.jbo.server.ViewRowImpl ;
    import oracle.jbo.server.ViewRowSetImpl ;
    import oracle.jdbc.OracleCallableStatement ;
    import oracle.jdbc.OracleConnection ;
    import oracle.jdbc.OracleTypes ;
    public class Profiles1ViewImpl extends ViewObjectImpl {
        private static final String SQL_STM = "begin Pkg_profile.get_profile_list(?,?,?,?);end;" ;
        public Profiles1ViewImpl () {
        /* 0. */
        protected void create () {
            getViewDef ().setQuery ( null ) ;
            getViewDef ().setSelectClause ( null ) ;
            setQuery ( null ) ;
        public Connection getCurrentConnection () throws SQLException {
            // Note that we never execute this statement, so no commit really happens
            Connection conn = null ;
            PreparedStatement st = getDBTransaction ().createPreparedStatement ( "commit" , 1 ) ;
            conn = st.getConnection () ;
            st.close () ;
            return conn ;
        /* 1. */
        protected void executeQueryForCollection ( Object qc , Object[] params , int numUserParams ) {
            storeNewResultSet ( qc , retrieveRefCursor ( qc , params ) ) ;
            // callStoredProcedure ( qc , SQL_STM ) ;
            super.executeQueryForCollection ( qc , params , numUserParams ) ;
        /* 2. */
        private ResultSet retrieveRefCursor ( Object qc , Object[] params ) {
            ResultSet rs = null ;
            rs = callStoredProcedure ( qc , SQL_STM ) ;
            return rs ;
        /* 3. */
        public ResultSet callStoredProcedure ( Object qc , String stmt ) {
            CallableStatement st = null ;
            ResultSet refCurResultSet = null ;
            try {
                st = getDBTransaction ().createCallableStatement ( stmt , 0 ) ; // call 
                st.setObject ( 1 , 571 ) ; //set id of my record to 571
                st.registerOutParameter ( 2 , OracleTypes.CURSOR ) ; // my ref_cursor
                st.registerOutParameter ( 3 , Types.NUMERIC ) ;
                st.registerOutParameter ( 4 , Types.VARCHAR ) ;
                st.execute () ; //executeUpdate
                System.out.println ( "Numeric " + st.getObject ( 3 ) ) ;
                System.out.println ( "Varchar " + st.getObject ( 4 ) ) ;
                refCurResultSet = ( ResultSet ) st.getObject ( 2 ) ; //set Cursoru to ResultSet
                //   setUserDataForCollection(qc, refCurResultSet); //don't work
                //   createRowFromResultSet ( qc , refCurResultSet ) ; //don't work
                /* this works but only one-time call - so my resultSet(cursor) really have a data
                while ( refCurResultSet.next () ) {
                    String nameProfile = refCurResultSet.getString ( 2 ) ;
                    System.out.println ( "Name profile: " + nameProfile ) ;
                return refCurResultSet ;
            } catch ( SQLException e ) {
                System.out.println ( "sql ex " + e ) ;
                throw new JboException ( e ) ;
            } finally {
                if ( st != null ) {
                    try {
                        st.close () ; // 7. Close the statement
                    } catch ( SQLException e ) {
                        System.out.println ( "sql exx2 " + e ) ;
        /* 4. Store a new result set in the query-collection-private user-data context */
        private void storeNewResultSet ( Object qc , ResultSet rs ) {
            ResultSet existingRs = getResultSet ( qc ) ;
            // If this query collection is getting reused, close out any previous rowset
            if ( existingRs != null ) {
                try {
                   existingRs.close () ;
                } catch ( SQLException s ) {
                    System.out.println ( "sql err " + s ) ;
            setUserDataForCollection ( qc , rs ) ; //should store my result set
            hasNextForCollection ( qc ) ; // Prime the pump with the first row.
        /*  5. Retrieve the result set wrapper from the query-collection user-data      */
        private ResultSet getResultSet ( Object qc ) {
            return ( ResultSet ) getUserDataForCollection ( qc ) ;
        // createRowFromResultSet - overridden for custom java data source support - also doesn't work
       protected ViewRowImpl createRowFromResultSet ( Object qc , ResultSet resultSet ) {
            ViewRowImpl value = super.createRowFromResultSet ( qc , resultSet ) ;
            return value ;
    }

    Hi I have the same problem like you ...
    My SQL Definition:
    CREATE OR REPLACE TYPE RMSPRD.NB_TAB_STOREDATA is table of NB_STOREDATA_REC
    CREATE OR REPLACE TYPE RMSPRD.NB_STOREDATA_REC AS OBJECT (
       v_title            VARCHAR2(100),
       v_store            VARCHAR2(50),
       v_sales            NUMBER(20,4),
       v_cost             NUMBER(20,4),
       v_units            NUMBER(12,4),
       v_margin           NUMBER(6,2),
       v_ly_sales         NUMBER(20,4),
       v_ly_cost          NUMBER(20,4),
       v_ly_units         NUMBER(12,4),
       v_ly_margin        NUMBER(6,2),
       v_sales_variance   NUMBER(6,2)
    CREATE OR REPLACE PACKAGE RMSPRD.NB_SALES_DATA
    AS
    v_sales_format_tab   nb_tab_storedata;
    FUNCTION sales_data_by_format_gen (
          key_value         IN       VARCHAR2,
          l_to_date         IN       DATE DEFAULT SYSDATE-1,
          l_from_date       IN       DATE DEFAULT TRUNC (SYSDATE, 'YYYY')
          RETURN nb_tab_storedata;
    I have a PLSQL function .. that will return table ..
    when i use this in sql developer it is working fine....
    select * from table (NB_SALES_DATA.sales_data_by_format_gen('TSC',
                                        '05-Aug-2012',
                                        '01-Aug-2012') )
    it returning table format record.
    I am not able to call from VO object. ...
    Hope you can help me .. please tell me step by step process...
    protected Object callStoredFunction(int sqlReturnType, String stmt,
    Object[] bindVars) {
    System.out.println("--> 1");
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement("begin ? := " +"NB_SALES_DATA.sales_data_by_format_gen('TSC','05-Aug-2012','01-Aug-2012') ; end;", 0);
    System.out.println("--> 2");
    st.executeUpdate();
    System.out.println("--> 3");
    return st.getObject(1);
    catch (SQLException e) {
    e.printStackTrace();
    throw new JboException(e);

  • Need help with BC4J/Struts application using a Stored Procedure

    Hi,
    I am doing a proof of concept for a new project using JDeveloper, Struts and BC4J. We want to reuse our Business logic that is currently residing in Oracle Stored Procedures. I previously created a BC4J Entity Object based on a stored procedure Using Oracle Stored Procedures but this stored procedure is a bit different in that it returns a ref cursor as one of the paramters. http://radio.weblogs.com/0118231/stories/2003/03/03/gettingAViewObjectsResultRowsFromARefCursor.html
    I tried the above method, but I am having some trouble with it. I keep getting the error ORA-01008: not all variables are bound when I test it using the AppModule tester.
    Here is the store procedure definition:
    CREATE OR REPLACE PACKAGE pprs_test_wrappers IS
    TYPE sn_srch_results IS REF CURSOR;
    PROCEDURE sn_srch_main_test
    (serial_num_in IN OUT VARCHAR2
    ,serial_coll_cd_in IN OUT NUMBER
    ,max_rows_allowed IN OUT NUMBER
    ,total_rows_selected IN OUT NUMBER
    ,message_cd_out IN OUT VARCHAR2
    ,query_results          OUT sn_srch_results
    END pprs_test_wrappers;
    And here is my code:
    package pprs;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    // --- File generated by Oracle Business Components for Java.
    public class LienCheckImpl extends ViewObjectImpl
    * This is the PLSQL block that we will execute to retrieve the REF CURSOR
    private static final String SQL =
    "begin ? := pprs_test_wrappers.sn_srch_main_test(?, ?, ?, ?, ?, ?);end;";
    public LienCheckImpl() {}
    * Overridden framework method.
    * Executed when the framework needs to issue the database query for
    * the query collection based on this view object. One view object
    * can produce many related result sets, each potentially the result
    * of different bind variable values. If the rowset in query is involved
    * in a framework-coordinated master/detail viewlink, then the params array
    * will contain one or more framework-supplied bind parameters. If there
    * are any user-supplied bind parameter values, they will PRECEED the
    * framework-supplied bind variable values in the params array, and the
    * number of user parameters will be indicated by the value of the
    * numUserParams argument.
    protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
    * If there are where-clause params (for example due to a view link)
    * they will be in the 'params' array.
    * We assume that if some parameter is present, that it is a Deptno
    * value to pass as an argument to the stored procedure.
    * NOTE: Due to Bug#2828248 I have to cast to BigDecimal for now,
    * ---- but this parameter value should be oracle.jbo.domain.Number type.
    String serialNumIn = null;
    BigDecimal serialCollCdIn = null;
    BigDecimal maxRowsAllowed = null;
    BigDecimal totalRowsSelected = null;
    String messageCdOut = null;
    if (params != null) {
    serialNumIn = (String)params[0];
    serialCollCdIn = (BigDecimal)params[1];
    maxRowsAllowed = (BigDecimal)params[2];
    totalRowsSelected = (BigDecimal)params[3];
    messageCdOut = (String)params[4];
    storeNewResultSet(qc,retrieveRefCursor(qc,serialNumIn,
    serialCollCdIn,
    maxRowsAllowed,
    totalRowsSelected,
    messageCdOut));
    super.executeQueryForCollection(qc, params, numUserParams);
    * Overridden framework method.
    * Wipe out all traces of a built-in query for this VO
    protected void create() {
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    * Overridden framework method.
    * The role of this method is to "fetch", populate, and return a single row
    * from the datasource by calling createNewRowForCollection() and populating
    * its attributes using populateAttributeForRow().
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
    * We ignore the JDBC ResultSet passed by the framework (null anyway) and
    * use the resultset that we've stored in the query-collection-private
    * user data storage
    rs = getResultSet(qc);
    * Create a new row to populate
    ViewRowImpl r = createNewRowForCollection(qc);
    try {
    * Populate new row by attribute slot number for current row in Result Set
    populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
    populateAttributeForRow(r,1, nullOrNewNumber(rs.getBigDecimal(2)));
    populateAttributeForRow(r,2, rs.getString(3));
    populateAttributeForRow(r,3, rs.getString(4));
    populateAttributeForRow(r,4, rs.getString(5));
    catch (SQLException s) {
    throw new JboException(s);
    return r;
    * Overridden framework method.
    * Return true if the datasource has at least one more record to fetch.
    protected boolean hasNextForCollection(Object qc) {
    ResultSet rs = getResultSet(qc);
    boolean nextOne = false;
    try {
    nextOne = rs.next();
    * When were at the end of the result set, mark the query collection
    * as "FetchComplete".
    if (!nextOne) {
    setFetchCompleteForCollection(qc, true);
    * Close the result set, we're done with it
    rs.close();
    catch (SQLException s) {
    throw new JboException(s);
    return nextOne;
    * Overridden framework method.
    * The framework gives us a chance to clean up any resources related
    * to the datasource when a query collection is done being used.
    protected void releaseUserDataForCollection(Object qc, Object rs) {
    * Ignore the ResultSet passed in since we've created our own.
    * Fetch the ResultSet from the User-Data context instead
    ResultSet userDataRS = getResultSet(qc);
    if (userDataRS != null) {
    try {
    userDataRS.close();
    catch (SQLException s) {
    /* Ignore */
    super.releaseUserDataForCollection(qc, rs);
    * Return a JDBC ResultSet representing the REF CURSOR return
    * value from our stored package function.
    private ResultSet retrieveRefCursor(Object qc,
    String serialNum,
    BigDecimal serialColCd,
    BigDecimal maxRows,
    BigDecimal totalRows,
    String messageCd ) {
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Register the first bind parameter as our return value of type CURSOR
    st.registerOutParameter(1,OracleTypes.CURSOR);
    * Set the value of the 2nd bind variable to pass id as argument
    if (serialNum == null) st.setNull(2,Types.CHAR);
    else st.setString(2,serialNum);
    if (serialColCd == null) st.setNull(3,Types.NUMERIC);
    else st.setBigDecimal(3,serialColCd);
    if (maxRows == null) st.setNull(4,Types.NUMERIC);
    else st.setBigDecimal(4,maxRows);
    if (totalRows == null) st.setNull(5,Types.NUMERIC);
    else st.setBigDecimal(5,totalRows);
    if (messageCd == null) st.setNull(6,Types.CHAR);
    else st.setString(6,messageCd);
    st.execute();
    ResultSet rs = ((OracleCallableStatement)st).getCursor(1);
    * Make this result set use the fetch size from our View Object settings
    rs.setFetchSize(getFetchSize());
    return rs ;
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Store a new result set in the query-collection-private user-data context
    private void storeNewResultSet(Object qc, ResultSet rs) {
    ResultSet existingRs = getResultSet(qc);
    // If this query collection is getting reused, close out any previous rowset
    if (existingRs != null) {
    try {existingRs.close();} catch (SQLException s) {}
    setUserDataForCollection(qc,rs);
    hasNextForCollection(qc); // Prime the pump with the first row.
    * Retrieve the result set wrapper from the query-collection user-data
    private ResultSet getResultSet(Object qc) {
    return (ResultSet)getUserDataForCollection(qc);
    * Return either null or a new oracle.jbo.domain.Number
    private static oracle.jbo.domain.Number nullOrNewNumber(BigDecimal b) {
    try {
    return b != null ? new oracle.jbo.domain.Number(b) : null;
    catch (SQLException s) { }
    return null;
    I created the view object in expert mode so there is no entity object. Can someone help? I don't have much time left to finish this.
    Also, could I have done this from the Entity object instead of the view object by registering the ref cursor OUT parameter in handleStoredProcInsert()?
    Thanks
    Natalie

    I was able to get the input parameter by putting the following in my struts actions class
    vo.setWhereClauseParam(0,request.getParameter("row0_SerialNum"));
    The full code is:
    package mypackage2;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jbo.html.BC4JContext;
    import oracle.jbo.ViewObject;
    import oracle.jbo.html.struts11.BC4JUtils;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public class LienCheckView1QueryAction extends Action
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
    BC4JContext context = BC4JContext.getContext(request);
    // Retrieve the view object instance to work with by name
    ViewObject vo = context.getApplicationModule().findViewObject("LienCheckView1");
    vo.setRangeSize(3);
    vo.setIterMode(ViewObject.ITER_MODE_LAST_PAGE_PARTIAL);
    // Do any additional VO setup here (e.g. setting bind parameter values)
    vo.setWhereClauseParam(0,request.getParameter("row0_SerialNum"));
    // default value for serialCollCd 1 is for Motor Vehicles
    vo.setWhereClauseParam(1,new oracle.jbo.domain.Number(1));
    // Default value for maxRows_allowed
    vo.setWhereClauseParam(2,new oracle.jbo.domain.Number(20));
    return BC4JUtils.getForwardFromContext(context, mapping);
    This doesn't always work properly though. The first time I press the query button, the SerialNum parameter is still null, however if I re-execute the query by pressing the query button again. It will work, and return the rows. I always have to query twice. Also the SerialNum attribute is set to a String in my view object, it is a varchar column in the database, but some serial number I enter give a "Error Message: oracle.jbo.domain.Number ". This happens even though the underlying BC4J is returning values for the query. I also get a "500 Internal Server Error java.lang.ClassCastException: java.lang.String on my View object's code at line 65 which is
    if (params.length>1) serialCollCdIn = (BigDecimal)params[1];
    This is an input paramter to the oracle stored procedure that defaults to a Number value of 1.
    Any idea what the problem is? Here is the full code for my view object:
    package mypackage1;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    // --- File generated by Oracle Business Components for Java.
    public class LienCheckViewImpl extends ViewObjectImpl
    * This is the PLSQL block that we will execute to retrieve the REF CURSOR
    private static final String SQL =
    "begin pprs_test_wrappers.sn_srch_main_test(?, ?, ?, ?, ?, ?);end;";
    private BigDecimal totalRows = null;
    private String messageCd = null;
    private BigDecimal serialColCd = null;
    private BigDecimal maxRows = null;
    public LienCheckViewImpl() {}
    * Overridden framework method.
    * Executed when the framework needs to issue the database query for
    * the query collection based on this view object. One view object
    * can produce many related result sets, each potentially the result
    * of different bind variable values. If the rowset in query is involved
    * in a framework-coordinated master/detail viewlink, then the params array
    * will contain one or more framework-supplied bind parameters. If there
    * are any user-supplied bind parameter values, they will *PRECEED* the
    * framework-supplied bind variable values in the params array, and the
    * number of user parameters will be indicated by the value of the
    * numUserParams argument.
    protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
    * If there are where-clause params (for example due to a view link)
    * they will be in the 'params' array.
    * We assume that if some parameter is present, that it is a Deptno
    * value to pass as an argument to the stored procedure.
    * NOTE: Due to Bug#2828248 I have to cast to BigDecimal for now,
    * ---- but this parameter value should be oracle.jbo.domain.Number type.
    String serialNumIn = null;
    BigDecimal serialCollCdIn = null;
    BigDecimal maxRowsAllowed = null;
    BigDecimal totalRowsSelected = null;
    String messageCdOut = null;
    if (params != null) {
    if (params.length>0) serialNumIn = (String)params[0];
    if (params.length>1) serialCollCdIn = (BigDecimal)params[1];
    if (params.length>2) maxRowsAllowed = (BigDecimal)params[2];
    storeNewResultSet(qc,retrieveRefCursor(qc,serialNumIn,
    serialCollCdIn,
    maxRowsAllowed));
    super.executeQueryForCollection(qc, params, numUserParams);
    * Overridden framework method.
    * Wipe out all traces of a built-in query for this VO
    protected void create() {
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    * Overridden framework method.
    * The role of this method is to "fetch", populate, and return a single row
    * from the datasource by calling createNewRowForCollection() and populating
    * its attributes using populateAttributeForRow().
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
    * We ignore the JDBC ResultSet passed by the framework (null anyway) and
    * use the resultset that we've stored in the query-collection-private
    * user data storage
    rs = getResultSet(qc);
    * Create a new row to populate
    ViewRowImpl r = createNewRowForCollection(qc);
    try {
    * Populate new row by attribute slot number for current row in Result Set
    //AddedByRegisNum
    populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
    System.out.println("AddedByRegisNum :" + rs.getBigDecimal(1));
    // OrigRegisNum
    populateAttributeForRow(r,1, nullOrNewNumber(rs.getBigDecimal(2)));
    System.out.println("OrigRegisNum :" + rs.getBigDecimal(2));
    // SerialNum
    populateAttributeForRow(r,2, rs.getString(3));
    System.out.println("SerialNum :" + rs.getString(3));
    // SerialNumDesc
    populateAttributeForRow(r,3, rs.getString(4));
    System.out.println("SerialNumDesc :" + rs.getString(4));
    // FlagExactMatch
    populateAttributeForRow(r,4, rs.getString(5));
    System.out.println("FlagExactMatch :" + rs.getString(5));
    // MessageCd
    populateAttributeForRow(r,5, messageCd);
    // TotalRows
    populateAttributeForRow(r,6, totalRows);
    catch (SQLException s) {
    throw new JboException(s);
    return r;
    * Overridden framework method.
    * Return true if the datasource has at least one more record to fetch.
    protected boolean hasNextForCollection(Object qc) {
    ResultSet rs = getResultSet(qc);
    boolean nextOne = false;
    try {
    nextOne = rs.next();
    * When were at the end of the result set, mark the query collection
    * as "FetchComplete".
    if (!nextOne) {
    setFetchCompleteForCollection(qc, true);
    * Close the result set, we're done with it
    rs.close();
    catch (SQLException s) {
    throw new JboException(s);
    return nextOne;
    * Overridden framework method.
    * The framework gives us a chance to clean up any resources related
    * to the datasource when a query collection is done being used.
    protected void releaseUserDataForCollection(Object qc, Object rs) {
    * Ignore the ResultSet passed in since we've created our own.
    * Fetch the ResultSet from the User-Data context instead
    ResultSet userDataRS = getResultSet(qc);
    if (userDataRS != null) {
    try {
    userDataRS.close();
    catch (SQLException s) {
    /* Ignore */
    super.releaseUserDataForCollection(qc, rs);
    * Overridden framework method
    * Return the number of rows that would be returned by executing
    * the query implied by the datasource. This gives the developer a
    * chance to perform a fast count of the rows that would be retrieved
    * if all rows were fetched from the database. In the default implementation
    * the framework will perform a SELECT COUNT(*) FROM (...) wrapper query
    * to let the database return the count. This count might only be an estimate
    * depending on how resource-intensive it would be to actually count the rows.
    public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
    Object[] params = viewRowSet.getParameters(true);
    String serialNumIn = (String)params[0];
    BigDecimal serialCollCdIn = (BigDecimal)params[1];
    BigDecimal maxRowsAllowed = (BigDecimal)params[2];
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Register the fourth bind parameter as our return value of type NUMERIC
    st.registerOutParameter(4,Types.NUMERIC);
    * Set the value of the 3 bind variables to pass as arguments
    if (serialNumIn == null) st.setNull(1, Types.CHAR);
    else st.setString(1,serialNumIn);
    if (serialCollCdIn == null) st.setNull(2,Types.NUMERIC);
    else st.setBigDecimal(2,serialCollCdIn);
    if (maxRowsAllowed == null) st.setNull(3, Types.NUMERIC);
    else st.setBigDecimal(3, maxRowsAllowed);
    st.execute();
    System.out.println("returning value of :" + st.getLong(4));
    return st.getLong(4);
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Return a JDBC ResultSet representing the REF CURSOR return
    * value from our stored package function.
    private ResultSet retrieveRefCursor(Object qc,
    String serialNum,
    BigDecimal serialColCd,
    BigDecimal maxRows) {
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Set the value of the bind variables
    System.out.println("SerialNumIn :" + serialNum);
    if (serialNum == null) st.setNull(1,Types.CHAR);
    else st.setString(1,serialNum);
    if (serialColCd == null) st.setNull(2,Types.NUMERIC);
    else st.setBigDecimal(2,serialColCd);
    if (maxRows == null) st.setNull(3,Types.NUMERIC);
    else st.setBigDecimal(3,maxRows);
    st.registerOutParameter(1, Types.CHAR); // serialNum
    st.registerOutParameter(2, Types.NUMERIC); // serialColCd
    st.registerOutParameter(3, Types.NUMERIC); // maxRows
    st.registerOutParameter(4, Types.NUMERIC); // totalRows
    st.registerOutParameter(5, Types.CHAR); // messageCd
    * Register the 6th bind parameter as our return value of type CURSOR
    st.registerOutParameter(6,OracleTypes.CURSOR);
    st.execute();
    ResultSet rs = ((OracleCallableStatement)st).getCursor(6);
    serialColCd = st.getBigDecimal(2);
    System.out.println("SerialColCd= " + serialColCd);
    maxRows = st.getBigDecimal(3);
    System.out.println("maxRows= " + maxRows);
    totalRows = st.getBigDecimal(4);
    System.out.println("totalRows= " + totalRows);
    messageCd = st.getString(5);
    System.out.println("messageCd= " + messageCd);
    * Make this result set use the fetch size from our View Object settings
    rs.setFetchSize(getFetchSize());
    return rs ;
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Store a new result set in the query-collection-private user-data context
    private void storeNewResultSet(Object qc, ResultSet rs) {
    ResultSet existingRs = getResultSet(qc);
    // If this query collection is getting reused, close out any previous rowset
    if (existingRs != null) {
    try {existingRs.close();} catch (SQLException s) {}
    setUserDataForCollection(qc,rs);
    hasNextForCollection(qc); // Prime the pump with the first row.
    * Retrieve the result set wrapper from the query-collection user-data
    private ResultSet getResultSet(Object qc) {
    return (ResultSet)getUserDataForCollection(qc);
    * Return either null or a new oracle.jbo.domain.Number
    private static oracle.jbo.domain.Number nullOrNewNumber(BigDecimal b) {
    try {
    return b != null ? new oracle.jbo.domain.Number(b) : null;
    catch (SQLException s) { }
    return null;
    Natalie

  • Errer when, Call from java to pl sql procedure with table out parameter

    Hi ,
    Please help me ? It's urgent for me .....
    My Oracle Code is like this ,
    CREATE TABLE TEST_TABLE ( DATE1 DATE, VALUE_EXAMPLE VARCHAR2(20 BYTE), VALUE2_EXAMPLE VARCHAR2(20 BYTE), VALUE3_EXAMPLE NUMBER ); CREATE OR REPLACE TYPE TONERECORDTEST AS OBJECT ( DATE1 DATE, VALUE_EXAMPLE VARCHAR2(20), VALUE2_EXAMPLE VARCHAR2(20), VALUE3_EXAMPLE NUMBER ); CREATE OR REPLACE TYPE TTESTTABLE IS TABLE OF TONERECORDTEST; CREATE OR REPLACE PACKAGE test_collection_procedures AS PROCEDURE testCallProcedureFromJava(start_time IN DATE, end_time IN DATE, table_data OUT TTesttable); END test_collection_procedures; / CREATE OR REPLACE PACKAGE BODY test_collection_procedures AS PROCEDURE testCallProcedureFromJava(start_time IN DATE, end_time IN DATE, table_data OUT TTesttable) IS BEGIN SELECT TONERECORDTEST(date1, value_example, value2_example, value3_example) BULK COLLECT INTO table_data FROM TEST_TABLE WHERE DATE1>=start_time AND DATE1<=end_time; END testCallProcedureFromJava; END test_collection_procedures;
    And my Java Code is like
    import java.sql.Connection; import java.sql.DriverManager; import oracle.jdbc.OracleCallableStatement; import oracle.jdbc.OracleTypes; import oracle.sql.ARRAY; import oracle.sql.ArrayDescriptor; import oracle.sql.STRUCT; import oracle.sql.StructDescriptor; public class testPLCollectionType { public static void main(java.lang.String[] args) { try{ //Load the driver Class.forName ("oracle.jdbc.driver.OracleDriver"); // Connect to the database Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@serverbd:1521:squema1","user", "password"); // First, declare the Object arrays that will store the data (for TONERECORDTEST OBJECT TYPE) Object [] p2recobj; Object [] p3recobj; Object [] p4recobj; // Declare the Object Arrays to hold the STRUCTS (for TTESTTABLE TYPE) Object [] p2arrobj; // Declare two descriptors, one for the ARRAY TYPE // and one for the OBJECT TYPE. StructDescriptor desc1=StructDescriptor.createDescriptor("TONERECORDTEST",conn); ArrayDescriptor desc2=ArrayDescriptor.createDescriptor("TTESTTABLE",conn); // Set up the ARRAY object. ARRAY p2arr; // Declare the callable statement. // This must be of type OracleCallableStatement. OracleCallableStatement ocs = (OracleCallableStatement)conn.prepareCall("{call test_collection_procedures.testCallProcedureFromJa va(?,?,?)}"); // Declare IN parameters. Realize that are 2 DATE TYPE!!! Maybe your could change with setDATE ocs.setString(1,"01-JAN-04"); ocs.setString(2,"10-JAN-05"); // Register OUT parameter ocs.registerOutParameter(3,OracleTypes.ARRAY,"TTESTTABLE"); // Execute the procedure ocs.execute(); // Associate the returned arrays with the ARRAY objects. p2arr = ocs.getARRAY(3); // Get the data back into the data arrays. //p1arrobj = (Object [])p1arr.getArray(); p2arrobj = (Object [])p2arr.getArray(); System.out.println("Number of rows="+p2arrobj.length); System.out.println("Printing results..."); for (int i=0; i<p2arrobj.length; i++){ Object [] piarrobj = ((STRUCT)p2arrobj).getAttributes();
    System.out.println();
    System.out.print("Row "+i);
    for (int j=0; j<4; j++){
    System.out.print("|"+piarrobj[j]);
    }catch (Exception ex){
    System.out.println("Exception-->"+ex.getMessage());
    Actually when i running the java program it is showing error
    Exception-->ORA-06550: line 1, column 58:
    PLS-00103: Encountered the symbol "VA" when expecting one of the following:
    := . ( @ % ;
    The symbol ":=" was substituted for "VA" to continue.
      I am not getting the error .Please help me out Dhabas Edited by: Dhabas on Jan 12, 2009 3:49 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    // Declare the callable statement.
    // This must be of type OracleCallableStatement.
    ..."{call test_collection_procedures.testCallProcedureFromJa va(?,?,?)}");Looks like Ja divorced va.

  • OraOLEDB.Oracle generates error when retreiving a table with anydata col

    Hi,
    I use OraOLEDB.Oracle to connect from VB6 to oracle, and ADODB recordsets.
    I have a procedure that returns a table (using a cursor), the table has a column of type sys.anydata.
    I get this error: ROW-00004: Invalid column datatype
    I have to mention that it works excelent for anything that does not contain sys.anydata.
    I use Oracle 9.2.
    Thanks in advance,
    pesq

    I tried your solution, but it didn't work. I get an error (incorrect column number):
    Caused by: java.sql.SQLException: Niepoprawny indeks kolumny
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:121)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:283)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:363)
    at (...).Row$1.createCallableStatement(Row.java:82)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:836)
    ... 69 more
    The code is following:
                        String query = "BEGIN insert into movement (doc_number) values ('abc') returning id into :?; END;";
                        OracleCallableStatement cs = (OracleCallableStatement) c.prepareCall(query);
                        cs.registerOutParameter(1, OracleTypes.NUMBER);
                        cs.execute();
                        LOG.debug("result:"+ cs.getInt(1));
    I used Oracle database 10.2.0.1 with jdbc thin driver ojdbc14.jar. Could you point out your configuration?
    Regards,
    Rafal Rusin
    www.mimuw.edu.pl/~rrusin

  • CatchAll block not catching JTA timeout with XA datasource

    Hi,
    We have a synchronous BPEL process with DB Adapters calling XA datasource. We configured a CatchAll block to catch any exception that may arise during the execution. JTA timeout is 5 min (300s). DB Adapter calls a procedure in which we have introduced delay using DBMS Lock API.
    Whenever the total invoke activities timeout is greater than 5min, JTA exception is occurring, but not getting caught in CatchAll block.
    Below is the log
    Error Message: {http://schemas.oracle.com/bpel/extension}runtimeFault
    Fault ID default/OnAlarmTest!2.0*soa_93bf9d67-975e-4998-b725-9c68903cd40f/BPELProcess1/818062-BpInv1-BpSeq0.3-3
    Fault Time Jan 6, 2015 6:04:12 PM
    Non Recoverable System Fault :
    <bpelFault><faultType>0</faultType><runtimeFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Global retry rollback fault thrown. The current JTA transaction is aborting due to an user rollback fault being thrown. The upstream component should retry in a new JTA transaction upon catching this fault. This exception was caused by a global retry fault being thrown from downstream component. The user had directed the BPEL engine to roll back the current JTA transaction and retry within new JTA transactions for the specified number of times and retry interval. There is no action recommended. </summary></part><part name="detail"><detail>ORABPEL-02198 Global retry rollback fault thrown. The current JTA transaction is aborting due to an user rollback fault being thrown. The upstream component should retry in a new JTA transaction upon catching this fault. This exception was caused by a global retry fault being thrown from downstream component. The user had directed the BPEL engine to roll back the current JTA transaction and retry within new JTA transactions for the specified number of times and retry interval. There is no action recommended. at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:336) at com.collaxa.cube.engine.ext.common.InvokeHandler.__invoke(InvokeHandler.java:1099) at com.collaxa.cube.engine.ext.common.InvokeHandler.handleNormalInvoke(InvokeHandler.java:594) at com.collaxa.cube.engine.ext.common.InvokeHandler.handle(InvokeHandler.java:132) at com.collaxa.cube.engine.ext.bpel.common.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:74) at com.collaxa.cube.engine.ext.bpel.common.wmp.BaseBPELActivityWMP.perform(BaseBPELActivityWMP.java:173) at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:2718) at com.collaxa.cube.engine.CubeEngine._handleWorkItem(CubeEngine.java:1197) at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1100) at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:76) at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:251) at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:330) at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4652) at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4583) at com.collaxa.cube.engine.CubeEngine._createAndInvoke(CubeEngine.java:714) at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:559) at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.createAndInvoke(CubeEngineBean.java:103) at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.syncCreateAndInvokeParticipate(CubeEngineBean.java:181) at sun.reflect.GeneratedMethodAccessor1631.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:103) at oracle.security.jps.ee.ejb.JpsAbsInterceptor$1.run(JpsAbsInterceptor.java:113) at java.security.AccessController.doPrivileged(Native Method) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460) at oracle.security.jps.ee.ejb.JpsAbsInterceptor.runJaasMode(JpsAbsInterceptor.java:100) at oracle.security.jps.ee.ejb.JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:154) at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:113) at sun.reflect.GeneratedMethodAccessor1095.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) at com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:68) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.oracle.pitchfork.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34) at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54) at com.oracle.pitchfork.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy311.syncCreateAndInvokeParticipate(Unknown Source) at com.collaxa.cube.engine.ejb.impl.bpel.BPELEngineBean_51369e_ICubeEngineLocalBeanImpl.__WL_invoke(Unknown Source) at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:39) at com.collaxa.cube.engine.ejb.impl.bpel.BPELEngineBean_51369e_ICubeEngineLocalBeanImpl.syncCreateAndInvokeParticipate(Unknown Source) at com.collaxa.cube.engine.delivery.DeliveryHandler.callCreateAndInvoke(DeliveryHandler.java:914) at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequestAnyType(DeliveryHandler.java:631) at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequest(DeliveryHandler.java:565) at com.collaxa.cube.engine.delivery.DeliveryHandler.request(DeliveryHandler.java:238) at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.request(CubeDeliveryBean.java:541) at sun.reflect.GeneratedMethodAccessor1630.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:103) at oracle.security.jps.ee.ejb.JpsAbsInterceptor$1.run(JpsAbsInterceptor.java:113) at java.security.AccessController.doPrivileged(Native Method) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460) at oracle.security.jps.ee.ejb.JpsAbsInterceptor.runJaasMode(JpsAbsInterceptor.java:100) at oracle.security.jps.ee.ejb.JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:154) at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:113) at sun.reflect.GeneratedMethodAccessor1095.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) at com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:68) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.oracle.pitchfork.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34) at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54) at com.oracle.pitchfork.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy307.request(Unknown Source) at com.collaxa.cube.engine.ejb.impl.bpel.BPELDeliveryBean_5k948i_ICubeDeliveryLocalBeanImpl.__WL_invoke(Unknown Source) at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:39) at com.collaxa.cube.engine.ejb.impl.bpel.BPELDeliveryBean_5k948i_ICubeDeliveryLocalBeanImpl.request(Unknown Source) at oracle.fabric.CubeServiceEngine.request(CubeServiceEngine.java:458) at oracle.integration.platform.blocks.mesh.SynchronousMessageHandler.doRequest(SynchronousMessageHandler.java:139) at oracle.integration.platform.blocks.mesh.MessageRouter.request(MessageRouter.java:182) at oracle.integration.platform.blocks.mesh.MeshImpl.request(MeshImpl.java:190) at sun.reflect.GeneratedMethodAccessor1570.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy325.request(Unknown Source) at oracle.integration.platform.blocks.soap.WebServiceEntryBindingComponent.doMessageProcessing(WebServiceEntryBindingComponent.java:1636) at oracle.integration.platform.blocks.soap.WebServiceEntryBindingComponent.processIncomingMessage(WebServiceEntryBindingComponent.java:1016) at oracle.integration.platform.blocks.soap.FabricProvider.processMessage(FabricProvider.java:113) at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:1187) at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:1123) at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:581) at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:235) at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:195) at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:487) at oracle.integration.platform.blocks.soap.FabricProviderServlet.doPost(FabricProviderServlet.java:523) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119) at java.security.AccessController.doPrivileged(Native Method) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460) at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103) at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) Caused by: oracle.fabric.common.FabricInvocationException: BINDING.JCA-12563 Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'test1' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the HR.PROC_DELAY1 API. An error occurred while preparing and executing the HR.PROC_DELAY1 API. Cause: java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation ORA-06512: at "SYS.DBMS_LOCK", line 201 ORA-06512: at "HR.PROC_DELAY1", line 7 ORA-06512: at line 1 Check to ensure that the API is defined in the database and that the parameters match the signature of the API. This exception is considered retriable, likely due to a communication failure. Because the global transaction is rolling back the invoke must be retried in a new transaction, restarting from the place of the last transaction commit. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "1013" to your deployment descriptor (i.e. weblogic-ra.xml). ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. at oracle.integration.platform.blocks.adapter.fw.jca.cci.EndpointInteractionException.getFabricInvocationException(EndpointInteractionException.java:75) at oracle.integration.platform.blocks.adapter.AdapterReference.getFabricInvocationException(AdapterReference.java:316) at oracle.integration.platform.blocks.adapter.AdapterReference.request(AdapterReference.java:219) at oracle.integration.platform.blocks.mesh.SynchronousMessageHandler.doRequest(SynchronousMessageHandler.java:139) at oracle.integration.platform.blocks.mesh.MessageRouter.request(MessageRouter.java:182) at oracle.integration.platform.blocks.mesh.MeshImpl.request(MeshImpl.java:190) at sun.reflect.GeneratedMethodAccessor1570.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:71) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy325.request(Unknown Source) at oracle.fabric.CubeServiceEngine.requestToMesh(CubeServiceEngine.java:858) at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:267) ... 146 more Caused by: BINDING.JCA-12563 Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'test1' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the HR.PROC_DELAY1 API. An error occurred while preparing and executing the HR.PROC_DELAY1 API. Cause: java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation ORA-06512: at "SYS.DBMS_LOCK", line 201 ORA-06512: at "HR.PROC_DELAY1", line 7 ORA-06512: at line 1 Check to ensure that the API is defined in the database and that the parameters match the signature of the API. This exception is considered retriable, likely due to a communication failure. Because the global transaction is rolling back the invoke must be retried in a new transaction, restarting from the place of the last transaction commit. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "1013" to your deployment descriptor (i.e. weblogic-ra.xml). ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:486) at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeJcaReference(JCAInteractionInvoker.java:572) at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeSyncJcaReference(JCAInteractionInvoker.java:545) at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAEndpointInteraction.performSynchronousInteraction(JCAEndpointInteraction.java:547) at oracle.integration.platform.blocks.adapter.AdapterReference.request(AdapterReference.java:179) ... 161 more Caused by: BINDING.JCA-11811 Stored procedure invocation error. Error while trying to prepare and execute the HR.PROC_DELAY1 API. An error occurred while preparing and executing the HR.PROC_DELAY1 API. Cause: java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation ORA-06512: at "SYS.DBMS_LOCK", line 201 ORA-06512: at "HR.PROC_DELAY1", line 7 ORA-06512: at line 1 Check to ensure that the API is defined in the database and that the parameters match the signature of the API. This exception is considered retriable, likely due to a communication failure. Because the global transaction is rolling back the invoke must be retried in a new transaction, restarting from the place of the last transaction commit. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "1013" to your deployment descriptor (i.e. weblogic-ra.xml). at oracle.tip.adapter.db.exceptions.DBResourceException.createXARetriableException(DBResourceException.java:686) at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:658) at oracle.tip.adapter.db.sp.SPUtil.createResourceException(SPUtil.java:180) at oracle.tip.adapter.db.sp.AbstractStoredProcedure.execute(AbstractStoredProcedure.java:131) at oracle.tip.adapter.db.sp.SPInteraction.executeStoredProcedure(SPInteraction.java:142) at oracle.tip.adapter.db.DBInteraction.executeStoredProcedure(DBInteraction.java:1167) at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:254) at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:357) ... 165 more Caused by: java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation ORA-06512: at "SYS.DBMS_LOCK", line 201 ORA-06512: at "HR.PROC_DELAY1", line 7 ORA-06512: at line 1 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548) at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:213) at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1111) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1488) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769) at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3954) at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:9353) at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1539) at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:99) at oracle.tip.adapter.db.sp.AbstractStoredProcedure.execute(AbstractStoredProcedure.java:123) ... 169 more </detail></part><part name="code"><code>com.collaxa.cube.engine.EngineException</code></part></runtimeFault></bpelFault>
    Request your suggestions/ pointers on this.
    Environment details
    SOA 11.1.1.7.0.
    Weblogic 10.3.6
    Oracle EE 11.2.0.1.0
    Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
    Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
    OS: Windows Server 2008R2 Enterprise
    Many thanks in advance.
    Sai

    You can use the SOA Fault Management Framework to capture this error and handle it accordingly.  Use a <test> condition in the fault policy file to test for the specific $fault values you're getting in this error and then link to what you need to execute to handle the error in the corresponding <action> element. In the fault binding file bind this aforementioned fault policy to the DB Adapter reference component via the <reference> element. Alternatively you could bind it to the composite if the test condition is sufficiently detailed enough.
    Hope it helps.

  • Statement.cancel() no longer works with WLS 8.1?

    Has anyone else had a problem with the cancel() method in oracle.jdbc.OracleCallableStatement
    on WLS 8.1 not doing a very good job of killing the thread in Oracle? We were
    using cancel() with weblogic.jdbc.pool.CallableStatement on WLS 6.1 and it does
    a very good job of killing the query on the Oracle side. But almost all of this
    package has been removed and we've been told we need to use the Oracle vendor
    package to get our stuff to work on 8.1. I decompiled both classes and they each
    have very different implementations of the cancel() method.
    I think I've managed to convert all of our DB access classes to the Oracle vendor
    package successfully, with the exception of this issue. We use cancel() let users
    cancel large queries and to cancel an existing query if a user tries to run a
    new one. Since we implemented it we've had a huge performance boost from the lack
    of runaway queries in the DB. It would be a real pain if we can't find a way to
    get the Oracle version to work. Any help or tales of similar experiences would
    be greatly appreciated.
    thx a lot,
    Matt Savino

    I did a search on Oracle MetaLink. I didn't see any Oracle-confirmed
    bugs related to cancel. I did see one user in the JDBC forum that
    was having a problem with a remote (not on the local machine)
    cancel. At this point, this case will need to be worked through
    support - they will need to generate a reproducer and assuming they
    do, file a tar with Oracle.
    "Stephen Felts" <[email protected]> wrote in message
    news:[email protected]...
    Regarding the wrappers - now I remember discussing this with you in thebeta newsgroup about a month ago.
    The goal was to make it transparent that everything was changed to bepassthrough in 8.1.
    The good news is that you can now use the vendor interface directly andget their extensions
    directly. That means that the wrapper for Oracle will be different fromthe wrapper for DB2.
    Further, any new excentions in the interface will become visible to theapplication.
    >
    The bad news is that this only works when the vendor has a definedinterface; it doesn't work
    if only a class is defined.
    This is a problem for some of the Oracle data type classes that don't havedefined interfaces
    and the reason why weblogic.vendor.oracle interfaces still need to be usedfor these classes.
    That also applies to BEA classes and weblogic.jdbc.pool only had classesdefined, not interfaces.
    >
    We should have documented change.
    Regarding the real problem of cancel(), the WLS JDBC code is not doinganything here
    except passing the cancel call through to the thin driver. My guess isthat this is
    a problem in the thin driver. I haven't had a chance to research this onthe Oracle site yet.
    >
    >
    "Matt Savino" <[email protected]> wrote in message
    news:[email protected]...
    >>
    Thanks a ton for your quick reply on this. On recommendation from yoursupport
    team (case 426562) here is the primary line that we had to change:
    [old] weblogic.jdbc.pool.CallableStatement cStat
    =(weblogic.jdbc.pool.CallableStatement)connection.prepareCall(call);
    >>
    [new] - oracle.jdbc.OracleCallableStatement cStat
    =(oracle.jdbc.OracleCallableStatement)connection.prepareCall(call);
    >>
    (FYI - We need this to take adavantage of some of the advanced Oraclefeatures
    like returning multiple ResultSets. We'd like to avoid using the OCIclient if
    possible, assuming that would even solve this.)
    Further down in the code, here is the cancel() method:
    public void cancelCall() {
    try {
    if (cStat != null) cStat.cancel();
    releaseConnection();
    catch (Exception e){ e.printStackTrace(); }
    In both cases the cancel() call throws no error, but only on the oldversion do
    we actually see the thread die promptly in Oracle.
    Thanks again for your help on this,
    Matt
    "Stephen Felts" <[email protected]> wrote:
    In versions prior to WLS 8.1, each Oracle extension had to be
    individually,
    explicitly wrapped
    (and not all extensions were supported).
    In WLS 8.1, it is a clean passthrough directly of all Oracle interfaces
    using a dynamic proxy so that
    all Oracle extensions show through. The only additional work that WLS
    is doing to to
    ensure that transactions are managed correctly (which shouldn't have
    an impact here).
    Note that in versions prior to WLS 8.1, you were using classes12.zip
    for the client and now you are using ojdbc14.jar. There are
    some big differences in this client implementation.
    Maybe you should try testing this standalone without WLS in the picture
    to see
    if this is a driver problem. WLS doesn't have the code that isresponsible
    for killing the thread in Oracle.
    I'm not sure I understand what code you are changing. The goal was to
    preseve the interfaces
    provided in releases prior to 8.1. Code you show me an old code line
    and what you are
    changing it to? Thanks.
    "Matt Savino" <[email protected]> wrote in message
    news:[email protected]...
    >>>>
    Has anyone else had a problem with the cancel() method inoracle.jdbc.OracleCallableStatement
    on WLS 8.1 not doing a very good job of killing the thread in Oracle?We were
    using cancel() with weblogic.jdbc.pool.CallableStatement on WLS 6.1and it does
    a very good job of killing the query on the Oracle side. But almostall of this
    package has been removed and we've been told we need to use the
    Oracle
    vendor
    package to get our stuff to work on 8.1. I decompiled both classesand they each
    have very different implementations of the cancel() method.
    I think I've managed to convert all of our DB access classes to theOracle vendor
    package successfully, with the exception of this issue. We use
    cancel()
    let users
    cancel large queries and to cancel an existing query if a user triesto run a
    new one. Since we implemented it we've had a huge performance boostfrom the lack
    of runaway queries in the DB. It would be a real pain if we can't
    find
    a way to
    get the Oracle version to work. Any help or tales of similar
    experiences
    would
    be greatly appreciated.
    thx a lot,
    Matt Savino

  • 2.1.0.62: Problem with Package.Functions and Unit Tests

    I like the new Sqldeveloper - I startet trying Unit Tests as described here: Link: [http://www.oracle.com/technology/obe/11gr2_db_prod/appdev/sqldev/sqldev_unit_test/sqldev_unit_test.htm#t4]
    It worked with a test-procedure. Now i am trying to test my package functions, but all i get is this:
    Die folgende Prozedur wurde ausgeführt.
    Ausführungsaufruf
    BEGIN
    :1 := "PKG_MYPACK"."CREATEFUNCTION"(IN_PROGRAMMEID=>:2,
    IN_AMOUNT=>:3,
    IN_SWS=>:4);
    END;
    Bind-Variablen verwendet
    1 INTEGER OUT (null)
    2 INTEGER IN 1
    3 INTEGER IN 10
    4 INTEGER IN 11
    Ausführungsergebnisse
    ERROR
    Ungültige Konvertierung angefordert
    oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110)
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:171)
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:439)
    oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7723)
    oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7496)
    oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7978)
    oracle.jdbc.driver.OracleCallableStatement.setObject(OracleCallableStatement.java:4063)
    oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:221)
    oracle.dbtools.raptor.datatypes.strategies.callablestatement.CallableBindingDatum.customBindIN(CallableBindingDatum.java:135)
    oracle. ...
    what can i do?

    Created
    Bug 8976245 - EA1: UNIT_TEST: INVALID CONVERSION ERROR USING INTEGER PARAMETER
    and have asked bug responder to keep you updated on status here in the forum.
    Bad news is that any INTEGER parameter for which you specify a non-null value will fail.
    Possibly helpful news is that if you create a 'clone' of you function using NUMBER as the data type, you can continue to experiment with how unit testing may be of use to you.
    Sorry no instant answer. :(
    Brian
    SQL Developer Team

Maybe you are looking for

  • Billing unactive orders

    Hi to all, I have huge problem with billing some specific orders. I have to create bill for order that is 3 positions. Positions are created with unlimited change. I need to create 2 separate bills for one positions, that isn't active any more. I can

  • Problem Getting Output Dot on ICON

    Attached is a VI that reads the light sensors on our Robot and converts the values to a state that should be easy to use in Case blocks. Obviously, we don't know what we are doing because none of us can get the 'State' output to actually be an output

  • Airport Extreme won't connect

    We have had our airport extreme connected to the internet for a year but recently it will no longer send out a signal with out modem. The modem has been checked by several techs who say it's in working order, and will allow internet when plugged dire

  • Flex Compiler Error

    If I have a project in Flash Builder 4.6 that uses a specifc (custom) SDK name, that same project will see an error when you attempt to import it into Flash Builder 4.7. The project folder will show an X, indicating the original SDK cannot be found.

  • Enchancement in va01

    hi experts, Im doing an enhancement in VA01. The BADI I am using is cfop_det_prep   . My task is in the Conditions TAB in Item Conditions. My main purpose is that i want to pick the value of Discount (Condition : SOC) (Screen Field : KOMV-KBETR ) and