ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Pass Array/Table Oracle type using JDBC Configurable Service

Post new topic  Reply to topic
 Pass Array/Table Oracle type using JDBC Configurable Service « View previous topic :: View next topic » 
Author Message
talalanwar
PostPosted: Fri Jul 04, 2014 1:44 pm    Post subject: Pass Array/Table Oracle type using JDBC Configurable Service Reply with quote

Newbie

Joined: 26 Jan 2013
Posts: 7

I have Oracle procedures that takes input a user-defined Type. UDT is an array of Object(Another UDT). Below are the Type declarations.


Code:
create or replace Type R_OpenCloseRecords as Object(VSerial_No  number, VError_Code varchar2(2), VReason varchar2(255), VStatus char(1));
create or replace Type T_OpenCloseType as varray(100) of R_OpenCloseRecords ;


procedure UpdateOpenCloseRecord(VOpenCloseType in T_OpenCloseType);


I have also tried the above with table of records.

I have tried the above scenario with java oracle types ArrayDescriptor and StructDescriptor. But it returns with this exception: oracle.jdbc.driver.LogicalConnection incompatible with oracle.jdbc.OracleConnection


If i use java.sql.Struct it works fine for Object type, but the createArrayOf method fails with exception: Unsupported Feature.

Below is my java code snippet:
Code:
callableStatement = connection.prepareCall("{call " + schemaPackageName + ".UpdateOpenCloseRecord(?)}");         
      //callableStatement.registerOutParameter(1, Types.OTHER);
      callableStatement.setQueryTimeout(timeOut);
      
//      StructDescriptor R_OpenCloseRecords = StructDescriptor.createDescriptor("R_OpenCloseRecords", connection);
//      Object[] arrayObjectRecord = { data.getSerialNo(), data.getErrorCode(), data.getReason(), data.getStatus() };
//      STRUCT RecordStruct = new STRUCT(R_OpenCloseRecords, connection, arrayObjectRecord );
      
      Object[] arrayObjectRecord = { Integer.parseInt(data.getSerialNo()), data.getErrorCode(), data.getReason(), data.getStatus() };
      Struct recordStruct = connection.createStruct((schemaName+ ".R_OpenCloseRecords").toUpperCase(), arrayObjectRecord);
      
//      STRUCT[] arrayObjectTable = {RecordStruct};
//      ArrayDescriptor T_OpenCloseType = ArrayDescriptor.createDescriptor(
//            schemaPackageName+ ".T_OpenCloseType", connection);
//      VOpenCloseArray = new ARRAY(T_OpenCloseType, connection, arrayObjectTable);
      
      Object[] arrayObjectTable = {recordStruct};
      
      callableStatement.setObject(1,connection.createArrayOf((schemaName+ ".T_OpenCloseType").toUpperCase(),  arrayObjectTable) );
      //callableStatement.setObject(1, arrayObjectTable, Types.ARRAY);
      //callableStatement.setArray(1,VOpenCloseArray);
      callableStatement.execute();


You may see the use of descriptors in comments. Connection is acquired using getJDBCType4Connection of MbJavaComputeNode.

Awaiting your reply.
Back to top
View user's profile Send private message
talalanwar
PostPosted: Sat Jul 05, 2014 9:04 am    Post subject: Reply with quote

Newbie

Joined: 26 Jan 2013
Posts: 7

Issue is resolved by externally referencing the ojdbc jar which actually doesn't include the jar within the bar file
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Pass Array/Table Oracle type using JDBC Configurable Service
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.