Trying to pass a class as a parameter

I am converting code written by someone else in VB6.  They had a lot of global variables and I am trying to find a way to use a class as a parameter so I can pass it to multiple forms.  I can’t get the method to accept the class.
Here is the class definition:
    public class CommonCode
        public class gArrayContainer
            public gArrayContainer()
                dateTimeInputRecord = null;
                strPanelData = null;
                strTimeSelected = null;
                strPanelPresent = null;
            public gArrayContainer(int intNumberOfInputRecords)
                dateTimeInputRecord = new DateTime[intNumberOfInputRecords];
                strPanelData = new string[intNumberOfInputRecords, 4, 25, 8, 17, 12];
                strTimeSelected = new string[intNumberOfInputRecords];
                strPanelPresent = new string[intNumberOfInputRecords, 4, 25];
            public DateTime[] dateTimeInputRecord { get;set; }
            public string[,,,,,] strPanelData { get; set; }
            public string[] strTimeSelected { get; set; }
            public string[,,] strPanelPresent { get; set; }
            public string strTest {get; set;}
This is where I am calling from:
private
void openBarButtonItem_ItemClick(object
sender, DevExpress.XtraBars.ItemClickEventArgs e)
try
CommonCode cmn =
new
CommonCode();
                CommonCode.gArrayContainer
gArrayContainerInstance = new
CommonCode.gArrayContainer();
                cmn.mnuFileOpen(CallMe, gArrayContainerInstance);
catch (Exception
exc)
Console.WriteLine(exc);
throw exc;
And this is the method I’m trying to call:
public
void mnuFileOpen(PassStatusBackFunction
messageCallback, gArrayContainerInstance )
try
string strStartDirectory =
string strDataPath =
string strDataFile =
string strDataFileTitle =
int intCount = 0;
                additional logic……
catch (Exception
exc)
                Console.WriteLine(exc);
throw exc;
How am I supposed to code the class in the calling location and the definition?
Thanks.

Also (not sure why you've chosen c#) it would be far easier for you to convert from VB6 to VB.Net than it would be to C#, I even think theres some pretty robust converters knocking around the tinterweb

Similar Messages

  • Passing Inner class name as parameter

    Hi,
    How i can pass inner class name as parameter which is used to create object of inner class in the receiving method (class.formane(className))
    Hope somebody can help me.
    Thanks in advance.
    Prem

    No, because an inner class can never have a constructor that doesn't take any arguments.
    Without going through reflection, you always need an instance of the outer class to instantiate the inner class. Internally this instance is passed as a parameter to the inner class's constructor. So to create an instance of an inner class through reflection you need to get the appropriate constructor and call its newInstance method. Here's a complete example:import java.lang.reflect.Constructor;
    class Outer {
        class Inner {
        public static void main(String[] args) throws Exception{
            Class c = Class.forName("Outer$Inner");
            Constructor cnstrctr = c.getDeclaredConstructor(new Class[] {Outer.class});
            Outer o = new Outer();
            Inner i = (Inner) cnstrctr.newInstance(new Object[]{o});
            System.out.println(i);
    }

  • How to pass a Class as a parameter of a method?

    I have a method like below. Inside this method I need to create a variable that his type is the type of the class I have passed as a method's parameter.
    For example, if I call the method like this "Meth1(ClassPerson);" insed the method I need to declare a  variable of class "ClassPerson", but if I call like "Meth1(ClassCity);" I need the same variable to be declared as a ClassCity.
    public function Meth1( /*I dont know what to put here*/   ):void{
         /*I dont know what to put here to declare my variable*/
         /*here
         comes
         more
         code
         using
         the
         variable*/
    I tried as below but dont worked:
    public function Meth1( classtype:Class):void{
         var var1:classtype = new classtype();
    Can someone help me?

    evyatarBH, after declare the variable like you said an error occurs when I try to access some property of the variable. I receive a mesage telling that this property dont exists.
    public function Meth1( classtype:Class ):void{
         var var1:* = new ClassFactory(classe);
         //when I try to do something like the line below the error appear
         inputtext1.text = var1.fieldname;
    rashare, I can't do this because I can't declare the object before the method is called. I must inform to the method only which class I will use, but the object must be created only inside the method.

  • How to pass entire class as a parameter in a method of other class- OpenScr

    Hi Folks,
    Whenever we create a script in OpenScript, it can contain only one class. However I want to declare several variables in a class/script and pass this entire class B as a parameter in a methodA of classA.
    What I mean by mean that is , I create ClassB something like below
    public class MyParams.....
    variable1;
    variable2;
    variable3;
    variable4;
    variable5;
    public class Original.....
    public void methodA(MyParams params)
    params = new MyParams();
    field1 = params.variable1;
    field2 = params.variable2;
    field3 = params.variable3;
    field5= params.variable5;
    Edited by: OATS Explorer on Mar 8, 2012 1:53 AM

    Hi
    I have a stand alone program (can be used by all other users) which will accept request_id and To_Email as parameters. I am developing a new request set in which I want to incldue this stand alone program and want to pass Prog#1 request Id to the 2nd stand alone program as a parameter so that I can send the output of the Prog#1 to the users through E-mail.
    Do we have any options to pass Prog#1 requeset id in to Prog#2 as a parameter in the request set without modifying the stand alone concurrent program code.
    Please note that i dont want to change stand alone program code becuase this code/program was developed to work in general for all the users and I dont want to change this code for new requirement/purpose...
    Hope you understood my requirement...
    Thanks!!

  • How to passing multiple values for a parameter of discoverer(url parameters

    Hi All,
    I am trying to pass multiple values for a parameter of disco report. I am trying to include my url for discoverer viewer report. the values has the following
    'jeff,mark'
    'sfophiee,angela'
    Thanks and Regards
    Venkat

    Hello Venkat,
    I know there are some problems with 10.1.2.0.2, maybe if you haven't done yet you can try with 10.1.2.2, assuming this version should be working for multiple parameter values :
    OracleAS Discoverer 10.1.2.2 is installed with the following patch :
    Patch 4960210 PLACEHOLDER BUG FOR AS/DS 10G R2 PATCH SET 2 10.1.2.2
    So, once installed you can try adding your parameter as param_<parameter_name>='sfophiee,angela'
    Hope this helps, otherwise feel free to log a Service Request to Support.
    Best Regards,
    Gianluca

  • Passing Item Number as a Parameter takes long time,need to make it optional

    Hi,
    I am trying to pass Inventory Item as a parameter in the discoverer report and it is taking long time to query the results. I am not sure how to make a parameter optional (Not Required)
    Please advice
    Thanks,
    user12048986
    Edited by: user12048986 on Apr 19, 2010 2:54 PM

    Hi
    In order to use the value ALL in a list of values you have to do two things. These are:
    1. Create the LOV like you did with a SELECT 'ALL' FROM DUAL unioned to the real LOV
    2. Create a condition that looks for the word ALL
    Here's the condition:
    COLUMN_VALUE = :Parameter_Value OR :Parameter_Value = 'ALL'
    You could also make sure the value is in uppercase using this:
    COLUMN_VALUE = :Parameter_Value OR UPPER(:Parameter_Value) = 'ALL'
    This way if a user keyed 'all' it would still work.
    Best wishes
    Michael

  • Can someone tell what I have done wrong here trying to pass strings to a

    I have just started programming in java I can't see what I have done wrong here in my code can someone please help me?
    // Thomas Klooz
    // October 10, 2008
    /** A class that enters
    * DVD Info pass the arrays
    * DvdInventory Class and then manipulates the data from there*/
    import java.util.Scanner;// imports a scanner for use by the class
    public class DVDInfo
    public static void main(String args[])
    String theTitle[] = new String[10];// array of titles
    int inventory [] = new int[10];// array of ten for inventory
    int quantity []= new int[10];// array of ten for quantity
    double price []= new double[10];// array for the price of each double
    int count = 0;// variable to track what information is suppose to be passed to class
    System.out.println(" Welcome to DVD Inventory Program!");//Welcome message for the user
    System.out.println();//returns a blank line
    boolean stop = false;// boolean charcter to make program stop
    while(! stop)
    Scanner input = new Scanner( System.in );// creates scanner to use
    System.out.println(" Enter an item name or stop to Quit: ");// prompt user for input
    theTitle[count] = input.nextLine();// assigns the value to Title
    if (theTitle[count].equals("stop"))
    System.out.println();//returns a blank line
    System.out.println(" The DVD Inventory has been entered!");// diplay exit message to
    stop = true;
    } // end if
    else // continue to get data
    System.out.println();//returns a blank line
    System.out.println(" Enter the item number must be greater equal or greater than zero: ");// prompt user for input
    inventory[count] = input.nextInt();// assigns value to inventory
    if (inventory[count] < 0)// continue until proper value has been entered
    System.out.println( " Error no numbers can be below zero!");
    System.out.println(" Enter the item number must be greater equal or greater than zero: ");// prompt user for input
    inventory[count] = input.nextInt();// assigns value to inventory
    }// end if
    System.out.println();//returns a blank line
    System.out.println(" Enter the amount of DVDs you have must be greater than zero: ");// prompt user for input
    quantity[count]= input.nextInt();// assigns value to inventory
    if( quantity[count] <= 0)// continue to proper data is entered
    System.out.println( " Error: you have no inventory for this item ");// error message sent to user
    System.out.println(" Enter the amount of DVDs you have must be greater than zero: ");// prompt user for input
    quantity[count]= input.nextInt();// assigns value to inventory
    }//end if
    System.out.println();//returns a blank line
    System.out.println( " Enter the cost per DVD: ");// prompt user for input
    price[count] = input.nextDouble();// assigns the value to price
    count++;//increaments count 1
    }// end else
    }// end while
    DVDInventory myDVDInventory = new DVDInventory(theTitle,inventory,quantity,price,count); the problem seems to be here because this is where I get error message when I'm trying to pass to class named DVD
    }// end main
    }// end class

    this is the code that is important
    import java.util.Scanner;// imports a scanner for use by the class
    public class DVDInfo
    public static void main(String args[])
    String theTitle[] = new String[10];// array of titles
    int inventory [] = new int[10];// array of ten for inventory
    int quantity []= new int[10];// array of ten for quantity
    double price []= new double[10];// array for the price of each double
    int count = 0;// variable to track what information is suppose to be passed to class
    System.out.println(" Welcome to DVD Inventory Program!");//Welcome message for the user
    System.out.println();//returns a blank line
    boolean stop = false;// boolean charcter to make program stop
    while(! stop)
    Scanner input = new Scanner( System.in );// creates scanner to use
    System.out.println(" Enter an item name or stop to Quit: ");// prompt user for input
    theTitle[count] = input.nextLine();// assigns the value to Title
    if (theTitle[count].equals("stop"))
    System.out.println();//returns a blank line
    System.out.println(" The DVD Inventory has been entered!");// diplay exit message to
    stop = true;
    } // end if
    else // continue to get data
    System.out.println();//returns a blank line
    System.out.println(" Enter the item number must be greater equal or greater than zero: ");// prompt user for input
    inventory[count] = input.nextInt();// assigns value to inventory
    if (inventory[count] < 0)// continue until proper value has been entered
    System.out.println( " Error no numbers can be below zero!");
    System.out.println(" Enter the item number must be greater equal or greater than zero: ");// prompt user for input
    inventory[count] = input.nextInt();// assigns value to inventory
    }// end if
    System.out.println();//returns a blank line
    System.out.println(" Enter the amount of DVDs you have must be greater than zero: ");// prompt user for input
    quantity[count]= input.nextInt();// assigns value to inventory
    if( quantity[count] <= 0)// continue to proper data is entered
    System.out.println( " Error: you have no inventory for this item ");// error message sent to user
    System.out.println(" Enter the amount of DVDs you have must be greater than zero: ");// prompt user for input
    quantity[count]= input.nextInt();// assigns value to inventory
    }//end if
    System.out.println();//returns a blank line
    System.out.println( " Enter the cost per DVD: ");// prompt user for input
    price[count] = input.nextDouble();// assigns the value to price
    count++;//increaments count 1
    }// end else
    }// end while
    DVDInventory myDVDInventory = new DVDInventory(theTitle,inventory,quantity,price,count);
    }// end main
    }// end class The problem seems to be when I try to pass all the variables to the class DVDInventory the first statement after all. I get message that say can't find java. String
    Edited by: beatlefla on Oct 10, 2008 8:20 PM

  • PLS-00201 error when trying to pass an OUT parameter

    Hi,
    Please help me to resolve the below error:
    I am trying to pass an OUT parameter in a package.
    I have declared it in package specs as
    ProcABC(p_val IN varchar2, p_val2 IN varchar2, p_val3 OUT varchar2)
    In package body
    I have created the procedure as
    Create or Replace procedure ProcABC(p_val IN varchar2, p_val2 IN varchar2, p_val3 OUT varchar2) AS
    v_LogDir varchar2(40);
    v_message varchar2(200);
    BEGIN
    SELECT directory_path into v_LogDir FROM ALL_DIRECTORIES WHERE directory_name = 'ABC';
    v_message := v_LogDir ;
    some sql statements..
    p_val3 := v_message;
    Return p_val3;
    End procABC;
    SQL> exec pkg_A.procABC('Stage2', NULL, p_val3);
    Package compiles successfully but while execution it returns error as:
    ORA-06550: line 1, column 74:
    PLS-00201: identifier 'p_val3 ' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Please advise.

    Hi Suresh,
    Thanks for the information and help. I was able to run the package with this usage.
    Now, the issue is
    I need to return a v long string by the OUT parameter so I defined the datatype of OUT parameter as CLOB.
    But, when I declare local variable to run the package with this OUT paramater I get the error :
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 1
    When I pass a shorter string it works.
    Kindly advise me how to resolve this issue while using CLOB as datatype of OUT parameter.

  • Trying to pass parameters between GUI classes and methods

    Hi All.
    I have been working on a rather large final year project in college and it is getting close to the deadline. It looks as though I need to "tidy up" my code as it contains too many static methods, variables and other bad programming habits. My package consists of many different GUI's and classes. Up until now I have been calling different GUI's with guiName.NameOfMethod. I have been told this is bad practice so I am trying to fix this. Also instead of passing parameters correctly I have been creating static variables in my main class and using them. So for example if one class needed to pass a variable to the other I would first myGlobalVariable = X; in the first class. And then the second class can use this. This is also bad, right?
    So I guess im really just looking for a good example or tutorial on how to pass parameters between classes and methods, GUI if possible. Here is an example of how my GUI classes look:
    public class anotherGUI extends JFrame implements ActionListener {
            private JTextField a, b, c;
            private JButton button1, button2;
            JPanel p, p1;                   
            public anotherGUI() {
                LayOutAnotherGUI();
                setLocationRelativeTo(DnDMain.pictureArray[a]);
                setTitle("Example");
                setVisible(true);
                pack();     
            private void LayOutAnotherGUI(int c) {
         //GUI is layed out here     
            public void actionPerformed(ActionEvent e) {
                Object source = e.getSource();
                if (source == submit)
                    clickOK();
            public void clickOK(){
                //Here is where I have been accessing and modifying static global variables.  (But this needs to change).
    public void showanotherGUI() {
            new anotherGUI();
    }This is more or less how I have been going about creating my GUI's. These are used as pop ups. The user enters a value and then it is closed.
    To be honest I have been able to pass a variable correctly from one class to a GUI class but I have still having difficulty. For example in my code above I can pass the variable into this class but I cannot pass it into clickOK(). An this is where it is needed.
    Can anyone please help?
    I hope I have explained my problem well.
    Thanks in advance.

    I dont think that is what I need. An example of what I do in my program is:
    I have a main GUI with an array of images. There are a number of other small GUI's that appear for certain functions when the user clicks on an image or does some other function. I am trying to pass a value into the GUI class that is used for the smaller "pop up" GUI. So lets say the user has clicked the image in array[12]. Then a GUI is displayed. I need to pass the integer 12 into this class.
    Thanks.

  • Help: I am trying to pass a variable between classes

    I am trying to pass data in a variable inbetween two classes is there any suggestions as to how to do this? Here is a example of the code I am trying to pass MqMessage to the class MqLog.
    if(MqMessage.equals("END"))               
                                       finalize();
                                       System.exit( 0 );
                             else //else build flat file and launch docusolve
                                       MqLog tempMqLog = new MqLog();
                                       tempMqLog.levelThreeDiagnostic();
                                       aRuntime = null;
                                       aProcess = null;                                   
                                  }

    I don't really undestand what you are asking specifically. If you only want to transfer a value from one Object to another Object, then you should just use a set method:
    if (objectOne.getValue().equals("END"))
    end();
    else
    objectTwo.setValue(objectOne.getValue())

  • ORA-00932 when trying to pass ARRAY from Java SP to PL/SQL

    Hi all
    I am trying to pass ARRAYs back and forth between PL/SQL and Java stored procedures. But I keep getting:
    ORA-00932: inconsistent datatypes: expected a return value that is an instance of a user defined Java class convertible to an Oracle type got an object that could not be converted
    Here's my PL/SQL:
    create or replace type CONTENTP.sentences_array as VARRAY(1000) of CLOB
    -- I've also tried .. as TABLE of CLOB and varray/table of VARCHAR2
    declare
    proc_clob CLOB;
    arr SENTENCES_ARRAY;
    begin
    SELECT document_body
    into proc_clob
    from documents
    where document_id = 618784;
    arr := processdocument.sentencesplit (proc_clob);
    end;
    PROCESSDOCUMENT package definition:
    CREATE OR REPLACE PACKAGE CONTENTP.PROCESSDOCUMENT AS
    FUNCTION sentenceSplit(Param1 CLOB)
    return SENTENCES_ARRAY
    AS
    LANGUAGE java
    NAME 'com.contentp.documents.ProcessDocument.sentenceSplit(oracle.sql.CLOB) return oracle.sql.ARRAY';
    FUNCTION removeHTML(Param1 CLOB)
    return CLOB
    AS
    LANGUAGE java
    NAME 'com.contentp.documents.ProcessDocument.removeHTML(oracle.sql.CLOB) return oracle.sql.CLOB';
    end;
    Java sentenceSplit code:
    public static oracle.sql.ARRAY sentenceSplit ( CLOB text) throws IOException, SQLException
    Connection conn = new OracleDriver().defaultConnection();
    String[] arrSentences = sent.getsentences ( CLOBtoString (text) );
    ArrayDescriptor arrayDesc =
    ArrayDescriptor.createDescriptor ("SENTENCES_ARRAY", conn);
    ARRAY ARRSentences = new ARRAY (arrayDesc, conn, arrSentences);
    return ARRSentences;
    I have confirmed that the String[] arrSentences contains a valid string array. So the problem seems to be the creation and passing of ARRSentences.
    I have looked at pages and pages of documents and example code, and can't see anything wrong with my declaration of ARRSentences. I'm at a loss to explain what's wrong.
    Thanks in advance - any help is much appreciated!

    I am trying to do something similar but seems like getting stuck at registerOutParameter for this.
    Type definition:
    CREATE OR REPLACE
    type APL_CCAM9.VARCHARARRAY as table of VARCHAR2(100)
    Java Stored Function code:
    public static ARRAY fetchData (ARRAY originAreaCds, ARRAY serviceCds, ARRAY vvpcs) {
    Connection connection = null;
         ARRAY array = null;
         try {
         connection = new OracleDriver ().defaultConnection();
         connection.setAutoCommit(false);
    ArrayDescriptor adString = ArrayDescriptor.createDescriptor("VARCHARARRAY", connection);
    String[] result = new String [2];
    result[0] = "Foo";
    result[1] = "Foo1";
    array = new ARRAY (adString, connection, result);
    connection.commit ();
    return array;
    } catch (SQLException sqlexp) {
    try {
    connection.rollback();
    } catch (SQLException exp) {
    return array;
    Oracle Stored Function:
    function FETCH_TRADE_DYN_DATA (AREA_CDS IN VARCHARARRAY, SERVICE_CDS IN VARCHARARRAY,VV_CDS IN VARCHARARRAY) return VARCHARARRAY AS LANGUAGE JAVA NAME 'com.apl.ccam.oracle.js.dalc.TDynAllocation.fetchData (oracle.sql.ARRAY, oracle.sql.ARRAY, oracle.sql.ARRAY) return oracle.sql.ARRAY';
    Java Code calling Oracle Stored Procedure:
    ocs = (OracleCallableStatement) oraconn.prepareCall(queryBuf.toString());
                   ArrayDescriptor adString = ArrayDescriptor.createDescriptor("VARCHARARRAY", oraconn);
                   String[] originAreaCds = sTDynAllocationVO.getGeogAreaCds();
                   ARRAY areaCdArray = new ARRAY (adString, oraconn, originAreaCds);
                   ocs.registerOutParameter(1, OracleTypes.ARRAY);
                   ocs.setArray (2, areaCdArray);
                   String[] serviceCds = sTDynAllocationVO.getServiceCds();
                   ARRAY serviceCdsArray = new ARRAY (adString, oraconn, serviceCds );
                   ocs.setArray (3, serviceCdsArray);
                   String[] vvpcs = sTDynAllocationVO.getVesselVoyagePortCdCallNbrs();
                   ARRAY vvpcsArray = new ARRAY (adString, oraconn, vvpcs);
                   ocs.setArray (4, vvpcsArray);
    ocs.execute();
    ARRAY results = ocs.getARRAY(1);
    Error I get:
    Parameter Type Conflict: sqlType=2003
    Thanks for help in advance.

  • How to pass "EnterpriseManagementObject" Type as Function parameter?

    Hello, dear Colleagues.
    I'm trying to  pass "EnterpriseManagementObject" as Function parameter.
    Here is the piece of code:
    $SCSM = 'SERVER_NAME'
    function Add-Comment {
    param (
    [parameter(Mandatory=$true,Position=0)][Alias('Id')][String]$pSRId,
    [parameter(Mandatory=$true,Position=1)][Alias('Comment')][String]$pComment,
    [parameter(Mandatory=$true,Position=2)][Alias('EnteredBy')][String]$pEnteredBy,
    [parameter(Mandatory=$true,Position=3)][Alias('IsAnalyst')][Bool]$AnalystComment,
    [parameter(Mandatory=$true,Position=4)][Alias('IRObject')][EnterpriseManagementObject]$IRObject
    if ($IRObject) {
    $NewGUID = ([guid]::NewGuid()).ToString()
    if ($AnalystComment)
    $Projection = @{__CLASS = "System.WorkItem.Incident";
    __SEED = $IRObject;
    AnalystComments = @{__CLASS = "System.WorkItem.TroubleTicket.AnalystCommentLog";
    __OBJECT = @{"Id" = $NewGUID;
    Comment = $pComment;
    DisplayName = $NewGUID;
    EnteredBy = $pEnteredBy;
    EnteredDate = (Get-Date).ToUniversalTime();
    IsPrivate = $false
    New-SCSMObjectProjection -Type System.WorkItem.IncidentPortalProjection -Projection $Projection -ComputerName $SCSM -ErrorAction stop
    } else {
    Write-Host $pSRId "could not be found"
    $IncidentClass = Get-SCSMClass -name System.WorkItem.Incident$ -ComputerName $SCSM
    $Incident = Get-SCSMObject -Class $IncidentClass -Filter "name -eq $c" -ComputerName $SCSM
    Add-Comment -Id $c -Comment $text -EnteredBy $name -IsAnalyst $False -IRObject $Incident -ErrorAction stop
    With GetType() I watched $Incident is "EnterpriseManagementObject":
    IsPublic IsSerial Name BaseType
    True True EnterpriseManagementObject Microsoft.EnterpriseManagement.Common.EnterpriseManagementObjectBaseWithProperties
    But PS script returns error TypeNotFound:
    Add-Comment : Unable to find type [EnterpriseManagementObject]. Make sure that the assembly that contains this type is loaded.
    At C:\script.ps1:146 char:13
    + Add-Comment -Id $c -Comment $text -EnteredBy $name -IsAnalyst $True ...
    + ~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (EnterpriseManagementObject:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound
    Is there a way to  pass "EnterpriseManagementObject" as Function parameter?
    Thanks.

    First of all the error indicates that you haven't loaded the assembly which contains the class you're trying to load.
    Try loading the assembly by running:
    [Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.Core") | Out-Null
    Secondly if you want to use type based parameters restrictions you should use full type name, which can be found with the command:
    $SomeObject.GetType().FullName
    You should end up with: Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject

  • Passing Java statements in the parameter list

    I am relatively new to Java and have a need to create a method which has a Java statement passed to it in the parameter list. The purpose is to optionally run this statement within the method. For example:
    I have a method called rotateAndTranslate that sets up an Affine Transform by saving the existing transform context, creating a new transform, and then invoking that transform. After the new transform is invoked, I would like to have the ability to run different Java graphics commands (or not) before continuing with the remaining portion of the existing method (in this case, restoring the previous transform.
    I am not able to find any clear information on how to pass in Java statements and then invoke them.
    Can someone help with this? Please keep it simple as I am still trying to get my head around Java and OOP.
    Carl

    you're talking about closures, more or less, which java doesn't currently have
    you can get close to it by using anonymous inner classes. define an interface, say Transformer, and pass instances of that as arguments:
    public interface Transformer {
      void transform();
    Transformer transformer = new Transformer() {
       public void transform() {
            // do the work here
    MyTransformerClass.doTransform(transformer);
    ...obviously, the MyTransformerClass.doTransform() must take a Transformer as a parameter

  • Trying to pass Oracle array/object type to Java

    I have a Java class with two inner classes that are loaded into Oracle:
    public class PDFJ
        public static class TextObject
            public String font_name;
            public int font_size;
            public String font_style;
            public String text_string;
        public static class ColumnObject
            public int left_pos;
            public int right_pos;
            public int top_pos;
            public int bottom_pos;
            public int leading;
            public TextObject[] column_texts;
    }I have object types in Oracle as such that bind to the Java classes:
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_TEXT" AS OBJECT
    EXTERNAL NAME 'PDFJ$TextObject'
    LANGUAGE JAVA
    USING SQLData(
      "FONT_NAME" VARCHAR2(25) EXTERNAL NAME 'font_name',
      "FONT_SIZE" NUMBER EXTERNAL NAME 'font_size',
      "FONT_STYLE" VARCHAR2(1) EXTERNAL NAME 'font_style',
      "TEXT_STRING" VARCHAR2(4000) EXTERNAL NAME 'text_string'
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_TEXT_ARRAY" AS
      TABLE OF "PROGRAMMER"."PDFJ_TEXT";
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_COLUMN" AS OBJECT
    EXTERNAL NAME 'PDFJ$ColumnObject'
    LANGUAGE JAVA
    USING SQLData(
      "LEFT_POS" NUMBER EXTERNAL NAME 'left_pos',
      "RIGHT_POS" NUMBER EXTERNAL NAME 'right_pos',
      "TOP_POS" NUMBER EXTERNAL NAME 'top_pos',
      "BOTTOM_POS" NUMBER EXTERNAL NAME 'bottom_pos',
      "LEADING" NUMBER EXTERNAL NAME 'leading',
      "COLUMN_TEXTS" "PROGRAMMER"."PDFJ_TEXT_ARRAY" EXTERNAL NAME 'column_texts'
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_COLUMN_ARRAY" AS
        TABLE OF "PROGRAMMER"."PDFJ_COLUMN";
    /I successfully (as far as I know) build a PDFJ_COLUMN_ARRAY object in a PL/SQL procedure. The PDFJ_COLUMN_ARRAY contains PDFJ_COLUMN objects; each of those objects contains a PDFJ_TEXT_ARRAY of PDFJ_TEXT objects (Example: pdf_column_array(i).pdf_text_array(i).text_string := 'something';). In this procedure, I pass this PDFJ_COLUMN_ARRAY as a parameter to a Java function. I assume the Java function parameter is supposed to be a oracle.sql.ARRAY object.
    I cannot figure out how to decompose this generic ARRAY object into a ColumnObject[] array. I also tried Googling and searching the forums, but I can't figure out matching search criteria. I was wondering if anyone here knows anything about passing user-defined Oracle type objects to a Java function and retrieving the user-defined Java class equivalents that they are supposedly mapped to--especially a user-defined array type of user-defined object types containing another user-defined array type of user-defined object types.

    Ok. I will try asking on the JDBC forum. So, don't
    flame me for cross-posting. :PWe won't, if over there you just post basically a
    link to this one.
    sigh Guess what, he did it the flame-deserving way. It's crossposted at:
    http://forum.java.sun.com/thread.jspa?threadID=602805
    <flame level="mild">Never ceases to amaze me how people don't think that posting a duplicate rather than a simple link isn't wasteful, as people could end up answering in both of them, not seeing each other's answers</flame>

  • Passing a value for date parameter from Oracle Forms to BIP

    Hi
    I have created a report with the following SQL query:
    select
    d_tables.d_seq,
    to_date(d_tables.d_created) creation_date,
    d_tables.d_created_by created_by,
    d_tables.d_pk,
    d_tables.table_name,
    d_tables.comments
    from
    d_tables, d_applications
    where
    d_tables.d_ppk = d_applications.d_pk
    and to_date(d_tables.d_created) >= nvl(:P_CRE_DATE_FROM, to_date(d_tables.d_created))
    and to_date(d_tables.d_created) <= nvl(:P_CRE_DATE_TO, to_date(d_tables.d_created))
    The parameters P_CRE_DATE_FROM and P_CRE_DATE_TO have been set up as date in BI Publisher with format dd-MMM-yyyy
    The report works fine when launched in BI Publisher.
    I want to call this report from Oracle Forms and I'm trying to pass the values for both the parameters. However, the report does not generate output based on values passed.
    Does it have to do with datatype? Does anyone know a solution for this?
    Kind regards,
    Aparna

    Thanks for your suggestion. I am already referring to the whitepaper and have integrated Forms with BI Publisher. The parameter passing is working fine for a varchar2 type of parameter. However, for a date type, there seems to be some problem.

Maybe you are looking for

  • What is the largest pdf file that iBooks can read?

    I have two large maps (largest is 74MB).  They are in the iBooks library but when I try to display one, it thinks for about 10 seconds, then bombs back to the iBooks icon.  I have read a much smaller map pdf successfully.  So I'm thinking that I'm be

  • 10.1.3 JMS Cache Synchronization on OC4J

    Hi, We're using stand-alone OC4j 10.1.3.0 along with TopLink 10.1.3.0 (packaged with OC4j). In enabling JMS cache synchronization, I get the following error message: Exception [TOPLINK-12000] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118

  • Router Error Codes

    Hello, I am trying to find one of my router error codes, however I can't seem to locate the manual below. Can someone tell me how to find it? Error code from the ICM CallRouter process. For information about a specific Router ErrorCode, refer to the

  • What is wrong with my Photosmart 4795 printer?

    Online testing makes it work.  Won't work when I hit "print" from my computer.

  • I cant locate the facetime app on my phone

    Is is possible to delete the FaceTime app from the phone?  For the life of me I can't find it on my phone anymore.