In java ,how to access the  user-defined type of pl/sql?

in my application,i using the following code to access the pl/sql type self-defined,but it throws run-time exception,how can i resolve it?String sqlStr="{call BossStat.dunStat(?,?,?,?,?,?)}";
OracleCallableStatement ocstmt=(OracleCallableStatement)conn.prepareCall(sqlStr);
int paramIndexInt=1;
ocstmt.setInt(paramIndexInt++,100);
ocstmt.setInt(paramIndexInt++,1);
ocstmt.setInt(paramIndexInt++,1);
ocstmt.setTimestamp(paramIndexInt++,new java.sql.Timestamp(System.currentTimeMillis()));
ocstmt.setTimestamp(paramIndexInt++,new java.sql.Timestamp(System.currentTimeMillis()));
ocstmt.registerOutParameter(paramIndexInt++,OracleTypes.ARRAY,"BossStat.TP_STATLABELVAR");
ocstmt.execute();

You can have a look at this how to document
http://otn.oracle.com/sample_code/tech/java/codesnippet/jdbc/objects/ObjectTypes.html
You can apply similar concept if you want to use stored procedure.
If you still get problems, post the type that you have created and the error you are getting.
Chandar

Similar Messages

  • How to catch the user defined  exception in application service

    Hi All,
    How to catch the user defined  exception in application service  when it is throwed by the external service..
    Regards,
    Thirumurugan.

    Hi,
        Thanks for your reply,
            Actually I  am calling validate Login method of External service from the application service. When the login fails, my external service will throw user defined Exception.I want to catch the user defined Exception.
        But in the application service , validate Login method can catch  only Invocation Exception and Engine Exception.
       These two exception are present in the Application service remote interface.
      public com.sap.comptest.extsrv.accrjavawsvi__document.output.
    Ns1_validateLoginResponse validateLogin(com.sap.comptest.extsrv.accrjavawsvi__document.input.Ns1_validateLogin input) throws com.sap.caf.mp.base.exception.InvocationException, com.sap.caf.mp.base.exception.EngineException;
    User defined exception is not present there. When i include the webservice as external service in CAF, it suppossed to generate the java file for the custom exception of validate Login method and this generated file should be included in the application service remote interface..
    public com.sap.comptest.extsrv.accrjavawsvi__document.output.
    Ns1_validateLoginResponse validateLogin(com.sap.comptest.extsrv.accrjavawsvi__document.input.Ns1_validateLogin input) throws com.sap.caf.mp.base.exception.InvocationException, com.sap.caf.mp.base.exception.EngineException,
    (generated file name of user defined Excpetion.
      Then only  validate login method  of application service can catch  the user defined Exception which is thrown by the  external service.
    regards,
    Thirumurugan.p

  • How to let the user define the colors for each plots in the graph (I use LabVIEW 7)?

    How to let the user define the colors for each plots in the graph (I
    use LabVIEW 7)?

    Hi,
    Take a look at this example, it uses property nodes to select tha
    active plot and then changes the color of that plot.
    If you want to make the number of plots dynamic you could use a for
    loop and an array of color boxes.
    I hope this helps.
    Regards,
    Juan Carlos
    N.I.
    Attachments:
    Changing_plot_color.vi ‏38 KB

  • How to access the User's login portal ID?

    Hi all,
         How to access the user's portal login id??
       Thanks,
       Anirudh.

    Hi
    Try this
    String loginuser="";
         try{
              IWDClientUser wdUser = WDClientUser.getCurrentUser();
              IUser user = wdUser.getSAPUser();
              if(user != null)
                   IUserAccount acct[] = user.getUserAccounts();
                   if(acct[0] != null)
                        loginuser = acct[0].getLogonUid();
                        strUserid = strUserid + acct[0].getLogonUid();
    }catch(Exception e){
    Kind Regards
    Mukesh

  • How to access the Custom Data type variable given in Expression edit control To and From LabVIEW

    Hello, I would like to know how to access the custom data type variable given in the Espression Edit Control from LabVIEW and vice-versa
    Say, the FileGlobals.Reference_Handle (Custom Data Type Variable) contains the
    VISA I/O session (Which in turn contains VISA_DeviceName: String, Session: Number),
    Channel1: Number and
    Channel2: Number
    I am expecting the user to give FileGlobals.Reference_Handle as the input at the ExpressionEdit Control in the edit screen of the VI Call.
    I would like to know how to get the values of this custom data type to LabVIEW?
    Say, if I have the Cluster in LabVIEW like VISA I/O session (Deive Name and Session Number), Channel1 and Channel2
    how do i need to set this cluster to the Custom Data type variable in TestStand?
    Thanks and Regards
    Prakash 

    Hi,
    TestStand to LabVIEW: i didnt understand what you r trying to achieve. But if you are using references, Use Property nodes and Invoke nodes to achieve what you want in LabVIEW.
     LabVIEW to TestStand: check the image below: You need to click the button next to 'container'. I have used a cluster output in the VI.
    Hope this helps
    .......^___________________^
    ....../ '---_BOT ____________ ]
    ...../_==O;;;;;;;;_______.:/
    Attachments:
    1.JPG ‏187 KB

  • Dose oracle.sql.ArrayDescriptor support the user defined type in package?

    Hi folks:
    I get a obstacle in calling stored procedure by using JDBC driver (ojdbc14.jar).
    I have the following code:
    create or replace package xxx AS
    type var_table is table of varchar2(50);
    procedure(parameter in var_table);
    end xxx;
    When I use the jdbc driver try to create a type for
    oracle.sql.ArrayDescriptor arrayDes = oracle.sql.ArrayDescriptor.createDescriptor( "var_table ",connection);
    The SQLException is thrown out like those:
    Invalid name pattern:user_schema. var_table
    So, my question is : Dose oracle.sql.ArrayDescriptor not support the user defined type in package? And I also tried to define such type by using sql "create xxxx" outside of package, then there is no SQLException.
    Hopefully for your response and suggestion.Thanks...

    To my knowledge, the Oracle JDBC driver does not support using the ArrayDescriptor for array data types (varray or nested table) that are defined inside of a package. The same is true for StructDescriptor as well. If you want to use array and object data types, you must define them outside of a package. Then you'll be able to use the descriptors in your JDBC programs.

  • Issue in passing Oracle User Defined Types to PL SQL from Websphere Applica

    HI,
    I am facing an issue when trying to pass Oracle collection object(User Defined Types) from Java to PL SQL. The issue happens inside J2EE application which is running inside Websphere Application Server 6.x. My database is Oracle 10g and i am using ojdbc1.4.jar as thin driver.
    The issue is that when i pass the Oracle Object from java side, the attribute values of the collection objects at the Oracle PL SQL side is coming as empty. I have tried the same java code in a standalone application and it works fine. The issue happens only when the application is running inside WAS.
    Anybody has any idea how to pass Oracle User Defined Types from WAS 6.x server to Oracle PL SQL?

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

  • How to bind the user-defined watch to a specific server so that server's Health would show green ball and is linked to Monitoring watch?

    Hi,
    I create a user defined watch for BI4.1 ExplorerExplorationServer server in CMC -> Monitoring.
    Caution:
    node.ExplorerExplorationServer$'Server Running State'==1 ||
    node.ExplorerExplorationServer$'Server Running State'==2 ||
    node.ExplorerExplorationServer$'Server Running State'==4 ||
    node.ExplorerExplorationServer$'Server Running State'==6 ||
    node.ExplorerExplorationServer$'Server Running State'==7 ||
    node.ExplorerExplorationServer$'Health State'==1
    Danger:
    node.ExplorerExplorationServer$'Server Running State'==0 ||
    node.ExplorerExplorationServer$'Server Running State'==5 ||
    node.ExplorerExplorationServer$'Health State'==0
    However, in CMC -> Servers -> Explorer Services, the ExplorerExplorationServer shows "Information is not available" blue ball in Health.
    How do I bind the user-defined watch to a specific server so that server's Health would show green ball and is linked to Monitoring watch?
    Regards,
    Jin-Chong

    Hello JinChong,
    We had created User-defined Explorer watches on our environments and have run into issues.
    Have received many false alerts even though Explorer servers are running fine.
    After creating an AGS case it was informed to us that Explorer does not have monitoring capabilities.
    AGS is checking with solution architect of Explorer application about when the monitoring watches for explorer would be included.
    Regards,
    Rohit

  • How to raise the user defined Exceptions in XI ?

    Hi All
        I am learning XI ...i want know how to set up the user defined Exceptions
        in XI?
        Where and What are the settings need to be done ?
        Same time where can check the LOG file ? to see all the server information ?
    Welcome to your answers
    Regards
    Rakesh

    Rakesh,
    Check this weblogs which will guide you:
    /people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    /people/stefan.grube/blog/2005/12/30/test-user-defined-functions-for-the-xi-graphical-mapping-tool-in-developer-studio
    Also check this thread:
    Mapping test throughs exception for UDF that does'nt exist anymore
    ---Satish

  • How to create a user defined type base on existing table

    Hi Everyone,
    Are there any way to create a user defined type base on existing table us as :
    CREATE OR REPLACE Type MyTable Is Table Of PART%ROWTYPE;
    where Part is a table.
    Regards,
    JDang

    Hi JDAng,
    Can't be done. %ROWTYPE is a PL/SQL construct, and as such cannot be used in SQL.
    Regards
    Peter

  • How to distinguish the User-Defined-Function from Oracle Build-In function

    Hi Friends,
    I could get the function list form all_objects table by the SQL:
    select * from all_objects where object_type = 'FUNCTION'
    but there is no column in all_objects specify the function is build-in or user-defined.
    But I found in SQL Server there is a column "is_ms_shipped" in the sys.all_objects table. This column will specify the object is build-in or user-defined. I want to get the equivalent column in Oracle but failed.
    Could anyone tell me how to solve this problem?
    Thanks,
    Ricky

    Thanks Pavan.
    But if an user connects to database using "conn /as sysdba" syntax and creates a function. This user-defined funtion goes into the "SYS" schema also. I know it is not the best practise to create objects using sys user so I think your solution is right.
    Regards,
    Ricky

  • How to access the User Reports using 'Administrator' login in OBIEE 10g

    Is there any way to access the reports saved in Users/'My folders' using the Administrator Login?

    Hi User,
    Create a new shared folder.
    Provide access to all the users.
    Now, ask the user who created the report in 'My Folders' to save the report in this new shared folder.
    And, Delete those reports in 'My Folders'.
    Now, as the report is saved in New shared folder you can access - this one.
    Else--- Ask the user who created the report in my folder to make sure that it is available to all users. (Permissions - Permission should need to be provided for Administrator group)
    Thank you.

  • How to access the user-id property which is available in VM engine in the rulebase

    Hi Experts,
    The interview engine exposes various application constants and one of them is the user-id which gives the user-id of the current interview session. This is basically taken from the url for the web-determinations. We would want to use this property in the rule bases to take the user-id of the current interview session. Is there any function available in the Rulebase which will return this value? Or is there any other way to get this value in the rulebase?
    Thanks,
    KK

    The demo app is only available when at apple stores it's not actually a downloadable app.

  • How to get the user connection type

    hi all, I have a PAI process to execute only if the user is connected from ESS/MSS. how can I determine the type of connection, if u have some suggestions please help.
    thanks in advance.

    >
    mniakh mahmoud wrote:
    > hi all, I have a PAI process to execute only if the user is connected from ESS/MSS. how can I determine the type of connection, if u have some suggestions please help.
    > thanks in advance.
    I use function module WS_QUERY to do exactly this thing.  If it sends back RETURN = 'ITS" then it is connected to ESS/MSS.  This has worked in our 6.20 and ECC6 systems, though I guess it may not work in exactly the same way in your system.  There also might be a more modern method of a class to do the same thing. 
    CALL FUNCTION 'WS_QUERY'
           EXPORTING
    *           ENVIRONMENT    =
    *           FILENAME       =
                query          = 'WS'
    *           WINID          =
           IMPORTING
                return         = window_system
           EXCEPTIONS
    *           inv_query      = 1
                no_batch       = 2
                frontend_error = 3
                OTHERS         = 4.

  • How to save the user-defined Java source code

    Would you please tell me how to download all of the java source code in one software component.

    UDFs can be exported one by one as a .mte file...not at one go...

Maybe you are looking for

  • How to create a Webservice for Adobe Form(I need Coding)?

    Hi, I need coding for Webservice inorder to define the context structure for Adobe Form. In AdobeForm: 1) I create a dataconnection and while creating it i need to give WSDL Url. 2) I have created it. 3) But iam not getting the Context structure in t

  • Distort noise coming from internal speaker

    Hi I just purchased my first iMac about 3 months ago and just today while listening to iTune the speaker made a stranger cracking sound and now all audio on the mac sounds like distortion. Does this sound like a broken sound card? I restarted the mac

  • Set JTable to be uneditable?

    I create JTable using DefaultTableModel. I want user can only view the data but cannot edit value in each cell. How can I do that ?

  • 3GS Wifi greyed out, bluetooth won't connect, 4.3.3

    Soooooo I have done some trawling around on here and haven't really found something that has provided me a solution to my problem (described above). The story so far.... Now that I think about it I don't think my wifi has been working for a few weeks

  • Pixelated / Corrupt Quicktime Movie Export

    Final Cut Pro Version 7 Hey guys, So I've finished editing a long film of about 1 hour and 18 minutes. When I use the Export > To Quicktime Movie, my film comes out super pixelated after the first cut in Quicktime X. I suspect the file is corrupt bec