[OS-JIRA] Created: (CAY-244) Casting RAW

From: jir..bjectstyle.org
Date: Mon Nov 22 2004 - 08:19:47 EST

  • Next message: Cris Daniluk: "RE: [OS-JIRA] Closed: (CAY-234) Oracle BLOB error"

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-244

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-244
        Summary: Casting RAW
           Type: New Feature

         Status: Assigned
       Priority: Major

        Project: Cayenne
       Versions:
                 1.1

       Assignee: Andrus Adamchik
       Reporter: Diego IƱigo

        Created: Mon, 22 Nov 2004 8:19 AM
        Updated: Mon, 22 Nov 2004 8:19 AM
    Environment: Java, Oracle, Unix

    Description:
    I'm define to procedure in cayenne modeler:

    <procedure name="DESENCRYPT" schema="SYSTEM" returningValue="true">
        <procedure-parameter name="encrypted" type="VARBINARY" length="128" direction="out"/>
        <procedure-parameter name="plaintext" type="VARCHAR" length="100" direction="in"/>
    </procedure>

    the out variable is VARBINARY beucase in the procedure DB (oracle) the type varible out is RAW.

    My problem is, when define in java, I unknown, HOW casting the OUT VARBINARY:

    public byte[] encrypt(String in, HttpServletRequest request){
        try{
            DataContext ctxt = BasicServletConfiguration.getDefaultContext(request.getSession());
            ProcedureQuery query = new ProcedureQuery("DESENCRYPT");
            query.addParam("plaintext",in);
            QueryResult resultsCollection = new QueryResult();
            ctxt.performQuery(query, resultsCollection);
            List rowSets = resultsCollection.getRows(query);
            Iterator it = rowSets.iterator();
            HashMap retorno=null;
            if (it.hasNext()) {
                   List nextResultSet = (List)it.next();
                   retorno= (HashMap)nextResultSet.get(0);
            }

            ????? value = (?????)retorno.get("encrypted");

    I can't casting byte[] beucase get("encrypted") return Object.
    And I don't know what object return in the list, that corresponding the RAW type (Oracle) or VARBINARY in Cayenne.

    Thank you, and I wait for your response

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Mon Nov 22 2004 - 08:19:49 EST