How to use java.lang.Class.getMethod() and java.lang.reflect.Method.invoke(

I want to call a specified method of one class dynamically. I use the method
"getMethod()" in package "java.lang.Class" to get method and "invoke()" in
" java.lang.reflect.Method " to invoke method.
The problem is as following :
1. There are two argument in this method "getMethod(String MethodName , Class[] paremterTypes)" in package "Class". I have no idea about the second parameter " Class[] parameterTypes ".what does the argument exactly mean ?
2. There are two argument in the method "invoke(object obj, object[] obj)" in package "Method".
I have no idea about the second parameter "object[] obj ".what is mean ?
I pass " null " value to it and it works.But i pass anothers ,jvm will throw exception.

I have a generic Method Executer that has a method like
public Object execute(String className, String methodName, Object args)
    String fullClassName = packageName + className ;
    Class delegateClass = Class.forName(fullClassName);
    BaseDelegate delegate = (BaseDelegate)delegateClass.newInstance();
    Method method = null;
    if (args == null)
        method = delegateClass.getMethod(methodName, new Class[] {});
        obj = method.invoke(delegate,new Object[] {});
    else
        method = delegateClass.getMethod(methodName, new Class[] {args.getClass()});
        obj = method.invoke(delegate, new Object[]{args});
   }This seems to have problems when I call the method from a class like:
execute("CategoryDelegate", "getCategoryById", new Integer(4144));(I get a NoSuchMethodException)
The method I am trying to execute in CategoryDelegate looks like:
public Category getCategoryById(int categoryId) throws DelegateExceptionI think it has to deal with the difference in the way we handle Primitive Wrappers and Objects. Wrapper we have to use Interger.TYPE and with the rest of the Objects we have to use obj.class.
Am I doing something wrong here? Any suggestions to make it work for primitive wrappers as well as Objects?

Similar Messages

  • Forums - How to use java.lang.Class.getMethod() and java.lang.reflect.Metho

    I have similar question. I am trying to invoke a method with no parameters. I don't know how to do that. Can someone please help.
    for example.
    I have 2 methods.
    public void setMethod(String strPut){
    this.strPut = strPut;
    public String getMethod(){
    return strPut;
    Method method = objRef.class.getMethod("setMethod", new Class[]{String.class});
    Object objReturn = method.invoke(sqlWhere, new Object[] {"any String"});
    I can invoke setMethod but I don't know how to invoke getMethod().

    Hi
    Try using something like this...
    CustomClass objCustomClass = new CustomClass ();
    Class customClass = objCustomClass.getClass ();
    Method m = customClass.getMethod ("getMethodName", (Class[])null);
    String strContent = (String) m.invoke (objCustomClass, null);
    Thanks and regards,
    Pazhanikanthan. P

  • How to use ADS on SolMan instance and SAP standard PDF forms from ERP

    Hi there
    We have installed and configurated the ADS service on our Solution Manager (SolMan) Instance called SD1.
    SolMan Info: SAP Solution Manager 7.0; Stack 17; Java-Stack installed; SAP Netweaver 7.0
    All ADS test reports can be executed successfully:
    FP_TEST_00
    FP_PDF_TEST_00
    We have linked our ERP landscape (e.g. system ED1) to ADS service running on SolMan.
    ERP Info: ECC 6.0; Stack 13; no Java-Stack installed
    All ADS test reports can be executed successfully:
    FP_TEST_00
    FP_PDF_TEST_00
    We want to print PDF documents from SAP standard applications on our ERP landscape. Therefore we want to use standard PDF forms provided by SAP and also available in transaction SFP (e.g. form ISSR_NW670_RX_PDF).
    Problem: When we try to create a PDF document from the application we get an error message:
    Processing exception during a "Render" operation.#Request start time: Mon Feb 02 13:42:08 CET 2009#com.adobe.ProcessingException: Problem accessing data from Destination: dest:FP_ICF_DATA_ED1//sap/bc/fp/form/layout/ISSR_NW605_PDF.XDP?fp-language=DE&fp-cac
    I have also checked the trace (see below) and it seems that the system tries to get the form from the SolMan system and not from the ERP system. But the form is only installed on ERP system.
    Are there any ideas how to solve this problem?
    Thanks.
       Begin trace
       Adobe Document Services Mon Feb 02 14:30:15 CET 2009 Trace Results:
       Request initialization (including DOM construction and validation) processing elapsed time = 0 ms.
       Begin operation: Render, elapsed time = 0 ms.
             Gather input streams and options processing, elapsed time = 13 ms.
             Form template and form license processing elapsed time = 13 ms.
    Problem accessing data from Destination: dest:FP_ICF_DATA_ED1//sap/bc/fp/form/layout/ISSR_NW670_RX_PDF.XDP?fp-language=DE&fp-cacheinfo=2006-06-26T13%3a10%3a38Z%2406c26758-d4b6-4818-8928-bbed36a10089%240%24de%24v0%2e9
    com.adobe.ads.destination.DestinationException: File Not Found while reading Dest URL: http://:/sap/bc/fp/form/layout/ISSR_NW670_RX_PDF.XDP?fp-language=DE
    Fehler bei der Formularprozessierung (Workbench)
    Exception Stack Trace:
    com.adobe.ads.destination.DestinationException: File Not Found while reading Dest URL: http://:/sap/bc/fp/form/layout/ISSR_NW670_RX_PDF.XDP?fp-language=DE
    Fehler bei der Formularprozessierung (Workbench)
    at com.adobe.ads.destination.Destination.readUrlStream(Unknown Source)
    at com.adobe.ads.destination.Destination.readTemplate(Unknown Source)
    at com.adobe.ads.data.DestStreamData.getByteArray(Unknown Source)
    at com.adobe.ads.data.StreamData.getData(Unknown Source)
    at com.adobe.ads.data.StreamData.getRemoteData(Unknown Source)
    at com.adobe.ads.operation.support.RemoteRenderer.renderAll(Unknown Source)
    at com.adobe.ads.operation.support.RemoteRenderer.renderAll(Unknown Source)
    at com.adobe.ads.operation.Render.renderWithoutCache(Unknown Source)
    at com.adobe.ads.operation.Render.execute(Unknown Source)
    at com.adobe.ads.operation.ADSOperation.doWork(Unknown Source)
    at com.adobe.ads.request.Request.processOperations(Unknown Source)
    at com.adobe.ads.request.Request.process(Unknown Source)
    at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
    at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
    at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
    at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
    at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
    at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
    at SoapServlet.doPost(SoapServlet.java:51)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    End operation: Render, elapsed time = 44 ms.
    Begin operation: Render Log, elapsed time = 44 ms.
    Completed Merge. elapsed time = 72 ms.
    End operation: Render Log, elapsed time = 77 ms.
    Problem accessing data from Destination: dest:FP_ICF_DATA_ED1//sap/bc/fp/form/layout/ISSR_NW670_RX_PDF.XDP?fp-language=DE&fp-cacheinfo=2006-06-26T13%3a10%3a38Z%2406c26758-d4b6-4818-8928-bbed36a10089%240%24de%24v0%2e9
    com.adobe.ads.destination.DestinationException: File Not Found while reading Dest URL: http://:/sap/bc/fp/form/layout/ISSR_NW670_RX_PDF.XDP?fp-language=DE
    Fehler bei der Formularprozessierung (Workbench)
    Exception Stack Trace:
    com.adobe.ads.destination.DestinationException: File Not Found while reading Dest URL: http://:/sap/bc/fp/form/layout/ISSR_NW670_RX_PDF.XDP?fp-language=DE
       Fehler bei der Formularprozessierung (Workbench)
            at com.adobe.ads.destination.Destination.readUrlStream(Unknown Source)
            at com.adobe.ads.destination.Destination.readTemplate(Unknown Source)
            at com.adobe.ads.data.DestStreamData.getByteArray(Unknown Source)
            at com.adobe.ads.data.StreamData.getData(Unknown Source)
            at com.adobe.ads.data.StreamData.getFileDataBuffer(Unknown Source)
            at com.adobe.ads.remote.EJB_PDFAgent.addAttachments(Unknown Source)
            at com.adobe.ads.remote.EJB_PDFAgent.embedFiles(Unknown Source)
            at com.adobe.ads.operation.support.RenderErrorLog.embedCollateralFiles(Unknown Source)
            at com.adobe.ads.operation.support.RenderErrorLog.embedRenderCollateral(Unknown Source)
            at com.adobe.ads.operation.Render.handleRenderException(Unknown Source)
            at com.adobe.ads.operation.Render.execute(Unknown Source)
            at com.adobe.ads.operation.ADSOperation.doWork(Unknown Source)
            at com.adobe.ads.request.Request.processOperations(Unknown Source)
            at com.adobe.ads.request.Request.process(Unknown Source)
            at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
            at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
            at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
            at java.lang.reflect.Method.invoke(Method.java:391)
            at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
            at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
            at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
            at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
            at SoapServlet.doPost(SoapServlet.java:51)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
            at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
            at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
            at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
            at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
            at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
            at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
            at java.security.AccessController.doPrivileged(AccessController.java:215)
            at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
            at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
       Encountered a problem embedding Render collateral:
       PDFException getting file from PDF Document.
       Error Log written to server: /usr/sap/SD1/SYS/global//AdobeDocumentServices/renderErrorLog/errorFiles/2009.02.02.143015SAFPCP00RES.pdf
       Error Log file "2009.02.02.143015SAFPCP00RES.pdf" written to /usr/sap/SD1/SYS/global//AdobeDocumentServices/renderErrorLog/errorFiles
    Processing exception during a "Render" operation.
       Request start time: Mon Feb 02 14:30:15 CET 2009
    com.adobe.ProcessingException: Problem accessing data from Destination: dest:FP_ICF_DATA_ED1//sap/bc/fp/form/layout/ISSR_NW670_RX_PDF.XDP?fp-language=DE&fp-cacheinfo=2006-06-26T13%3a10%3a38Z%2406c26758-d4b6-4818-8928-bbed36a10089%240%24de%24v0%2e9; [Error Log file "2009.02.02.143015SAFPCP00RES.pdf" written to /usr/sap/SD1/SYS/global//AdobeDocumentServices/renderErrorLog/errorFiles]
       Exception Stack Trace:
       com.adobe.ProcessingException: Problem accessing data from Destination: dest:FP_ICF_DATA_ED1//sap/bc/fp/form/layout/ISSR_NW670_RX_PDF.XDP?fp-language=DE&fp-cacheinfo=2006-06-26T13%3a10%3a38Z%2406c26758-d4b6-4818-8928-bbed36a10089%240%24de%24v0%2e9; [Error Log file "2009.02.02.143015SAFPCP00RES.pdf" written to /usr/sap/SD1/SYS/global//AdobeDocumentServices/renderErrorLog/errorFiles]
            at com.adobe.ads.operation.Render.execute(Unknown Source)
            at com.adobe.ads.operation.ADSOperation.doWork(Unknown Source)
            at com.adobe.ads.request.Request.processOperations(Unknown Source)
            at com.adobe.ads.request.Request.process(Unknown Source)
            at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
            at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
            at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
            at java.lang.reflect.Method.invoke(Method.java:391)
            at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
            at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
            at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
            at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
            at SoapServlet.doPost(SoapServlet.java:51)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
            at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
            at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
            at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
            at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
            at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
            at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
            at java.security.AccessController.doPrivileged(AccessController.java:215)
            at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
            at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
       End trace, total elapsed time = 121 ms.
    Edited by: Sören Reiche on Feb 4, 2009 7:49 AM

    Hi there
    Our problem is solved. We had a problem with our ADS user passwords.
    Thanks.

  • How to use the different class for each screen as well as function.

    Hi Experts,
    How to use the different class for each screen as well as function.
    With BestRegards,
    M.Thippa Reddy.

    Hi ThippaReddy,
    see this sample code
    Public Class ClsMenInBlack
    #Region "Declarations"
        'Class objects
        'UI and Di objects
        Dim objForm As SAPbouiCOM.Form
        'Variables
        Dim strQuery As String
    #End Region
    #Region "Methods"
        Private Function GeRate() As Double
                Return Double
        End Function
    #End Region
    Public Sub SBO_Appln_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
            If pVal.BeforeAction = True Then
                If pVal.MenuUID = "ENV_Menu_MIB" Then
                End If
            Else ' Before Action False
                End If
        End Sub
    #End Region
    End Class
    End Class
    Rgds
    Micheal
    Vasu Anna Regional Feeling a???? Just Kidding
    Edited by: micheal willis on Jul 27, 2009 5:49 PM
    Edited by: micheal willis on Jul 27, 2009 5:50 PM

  • How to use the implementation class in propetty pallete

    Hi,
    I am using forms 10g....I have to insert horizontal scroll bar in text item..
    I have only class files instead of jar files ...how cani place the class file instead of jar file...
    How to use the implementation class in property palette to display the PJC
    Thanks,
    Ansaf.

    The Implementation Class must reflect the full name of the class. For instance, if the full class name is : xx.yyy.zz.class_name, then put this in the Implementation Class property of the corresponding item.
    Also, the class must be stored in the equivalent directory structure, so that, in my example: <DEV_HOME>/forms/java/xx/yyy/zz
    Francois

  • How to use .dll compiled in Delphi in Java?

    Can anyone provide me information how to use .dll compiled in Delphi in Java? The .dll Delphi program may be non-OOP program.

    Hi
    If You want to write anything in PASCAL then simply write JNI code in C++ and call functions from this DELPHI DLL, but remember about changing the order of parameters etc when You call it. I had exactly the same problem, but it is possible, and we succeed.
    You will need exact description of input parameters required by PASCAL functions and of output parameters. Then construct in C++ objects wchich looks in memory exacly the same as they will look if You will be using PASCAL. Then PASCAL function will interprete this area in memory as known structure and will run.
    Maciek

  • Using java.lang.reflect.Method.invoke on a static method?

    This is probably a FAQ, but I am finding it impossible to construct a search which answers this question for me.
    How do I call java.lang.reflect.Method.invoke on a static (e.g. class) method? Is it even possible?
    Thanks,
    dwh

    Is this of any help?
    http://www.esus.com/javaindex/j2se/jdk1.2/javalang/reflection/reflection.html
    Cheers,
    Joris

  • Using unsupported J2SE classes (e.g. java.util.*) with PersonalJava

    Hi everybody!
    Does anyone know how to use unsupported
    J2SE classes in a PersonalJava application?
    I would like to use for example the class
    java.util.Vector in my PersonalJava application,
    but I have not succeeded to do that.
    I would be grateful if someone could give
    me advice.
    -Toni
    [email protected]

    To use vector you have to be careful only to use the java 1.1.x functionality, ie don't use any of the functions that it inherits from Collections, as they were Java 1.2.
    In reality this means that you need to use addElement instead of add etc.
    Hope this helps
    Peter

  • How to use ssd as boot drive and hdd as storage on a macbook pro 13

    Does anyone know how to use SSD as boot drive and have HDD in optical bay as storage on a Macbook pro 13. I mean in that both drives work as one . by formatting using mac software . I would like to run all programs and OS but would love to have my downloads and useless data on run on my 1tb 5400rpm hdd without me have to manual send it there..

    Does anyone know how to use SSD as boot drive and have HDD in optical bay as storage on a Macbook pro 13. I mean in that both drives work as one
    Each drive mounts as a separate volume. There is no convenient way to make them look like one contiguous volume.*
    Franky, with an hdd and a ssd I would recommend you put your home dir on the hdd and leave the ssd for the OS and your key applications.  It's relatively easy to do and I think better than moving only portions of your stuff.
    How to Move the Home Folder in OS X – and Why
    * There are ways to to make musltiple volumes appear as one large drive but I think it is beyond the scope of this discussion and not appropriate to this configuration.

  • How to use pen tool in Adobe and Illustrator?

    How to use pen tool in Adobe and Illustrator?

    With the pen tool in Indesign, is there a way of making the points not join if you want to make a few single lines?

  • How to use stored procedures in DIAdem and Can the stored procedures be used to return values?

    Can anyone please tell me how to use stored procedures in diadem and to return values from it. Its really important, can you please answer it at the earliest.
    Thanks In advance
    spiya

    Hi Spria,
    I'm very sorry for the mix-up, I thought Allen was going to answer you back with the particulars that we found out. Check out the attached Word document and the below tidbits:
    The built-in DIAdem ODBC functions {SQL_...()} can only call stored functions, which return a scaler result {found then in SQL_Result(1,1)}. The syntax for this with an ORACLE db is
    "select function(parameters) from package"
    ...where package defaults to "dual" if you don't use your own package.
    There might be exceptions to that though, and the syntax will be different for other databases. Note that stored ORACLE procedures can NOT be called from the ODBC functions, instead you must use either ADO function calls in the DIA
    dem VBScript or the OO4O COM wrapper that ORACLE provides (this is described in further detail in the below Word document).
    Hope this helps,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments
    Attachments:
    Calling_ORACLE_Stored_Procedures_from_DIAdem.doc ‏28 KB

  • How to use same view as editable and read only in ADF

    Hi,
    how to use same view as editable and read only in ADF ?? How can we achieve this in TF's ???
    -mrudul

    Hi,
    Steven Davelaar wrote a presentation about this "Building Highly Reusable Taskflows"
    Starting slide 14 is where your use case comes into play
    Frank

  • How to use RMI Stub class in programming?

    Hi all,
    I'm new on RMI.
    Is there anyone can explain to me how to use RMI Stub class which is generated by invoking rmic command?
    For my testing, I can only invoke rmi object nethod via its remote interface. Then what is stub used for when we are coding?
    I do appreciate anyone's help.
    Thanks very much,
    Xianyi.Ye

    When the remote object binds itself to the registry, what is actually bound is the stub.
    So when the client does a registry lookup, what it gets is the stub. However from the client's point of view it is just some mystery object that implements the remote interface.
    So you never have to use it directly, it is all automatic.

  • How to use buttons in hcm process and forms?

    Hi Experts,
    I want to know how to use buttons in HCM process and form.
    And when i click on the button it was validating all the fields and it was throwing an error ( complete SACHP fields) i am not using this filed in any where of my form.
    So, please help in getting out of this error. And help me with some document, which method will  trigger once we click on the button.
    Thanks & Regards,
    Rocky

    You do not need to add this field to your list. In the view V_T588MFPROPS (SAP delivered), this field is set as mandatory. In configuration, you must maintain the view V_T588MFPROPC (Customer area) and make sure the field is not set to mandatory. This will override the SAP delivered setting and the error message will be not be displayed.
    Derrick Banks
    Banks & Company, LLC

  • How to use the Rectangle class to draw an image and center it in a JPanel

    I sent an earlier post on how to center an image in a JPanel using the Rectangle class. I was asked to send an executable code which will show the malfunction. The code below is an executable code and a small part of a very big project. To simplifiy things, it is just a JFrame and a JPanel with an open dialog. Once executed the JFrame and the FileDialog will open. You can then navigate to a .gif or a .jpg picture and open it. What I want is for the picture to be centered in the middle of the JPanel and not the upper left corner. It is also important to stress that, I am usinig the Rectangle class to draw the Image. The region of interest is where the rectangle is created. In the constructor of the CenterRect class, I initialize the Rectangle class. Then I use paintComponent in the CenterRect class to draw the Image. The other classes are just support classes. The MyImage class is an extended image class which also has a draw() method. Any assistance in getting the Rectangle to show at the center of the JPanel without affecting the size and shape of the image will be greatly appreciated.
    I have divided the code into three parts. They are all supposed to be on one file in order to execute.
    import java.awt.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class CenterRect extends JPanel {
        public static Rectangle srcRect;
        Insets insets = null;
        Image image;
        MyImage imp;
        private double magnification;
        private int dstWidth, dstHeight;
        public CenterRect(MyImage imp){
            insets = getInsets();
            this.imp = imp;
            int width = imp.getWidth();
            int height = imp.getHeight();
            ImagePanel.init();
            srcRect = new Rectangle(0,0, width, height);
            srcRect.setLocation(0,0);
            setDrawingSize(width, height);
            magnification = 1.0;
        public void setDrawingSize(int width, int height) {
            dstWidth = width;
            dstHeight = height;
            setSize(dstWidth, dstHeight);
        public void paintComponent(Graphics g) {
            Image img = imp.getImage();
         try {
                if (img!=null)
                    g.drawImage(img,0,0, (int)(srcRect.width*magnification), (int)(srcRect.height*magnification),
              srcRect.x, srcRect.y, srcRect.x+srcRect.width, srcRect.y+srcRect.height, null);
            catch(OutOfMemoryError e) {e.printStackTrace();}
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Opener().openImage();
    class Opener{
        private String dir;
        private String name;
        private static String defaultDirectory;
        JFrame parent;
        public Opener() {
            initComponents();
         public void initComponents(){
            parent = new JFrame();
            parent.setContentPane(ImagePanel.panel);
            parent.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            parent.setExtendedState(JFrame.MAXIMIZED_BOTH);
            parent.setVisible(true);
        public void openDialog(String title, String path){
            if (path==null || path.equals("")) {
                FileDialog fd = new FileDialog(parent, title);
                defaultDirectory = "dir.image";
                if (defaultDirectory!=null)
                    fd.setDirectory(defaultDirectory);
                fd.setVisible(true);
                name = fd.getFile();
                if (name!=null) {
                    dir = fd.getDirectory();
                    defaultDirectory = dir;
                fd.dispose();
                if (parent==null)
                    return;
            } else {
                int i = path.lastIndexOf('/');
                if (i==-1)
                    i = path.lastIndexOf('\\');
                if (i>0) {
                    dir = path.substring(0, i+1);
                    name = path.substring(i+1);
                } else {
                    dir = "";
                    name = path;
        public MyImage openImage(String directory, String name) {
            MyImage imp = openJpegOrGif(dir, name);
            return imp;
        public void openImage() {
            openDialog("Open...", "");
            String directory = dir;
            String name = this.name;
            if (name==null)
                return;
            MyImage imp = openImage(directory, name);
            if (imp!=null) imp.show();
        MyImage openJpegOrGif(String dir, String name) {
                MyImage imp = null;
                Image img = Toolkit.getDefaultToolkit().getImage(dir+name);
                if (img!=null) {
                    imp = new MyImage(name, img);
                    FileInfo fi = new FileInfo();
                    fi.fileFormat = fi.GIF_OR_JPG;
                    fi.fileName = name;
                    fi.directory = dir;
                    imp.setFileInfo(fi);
                return imp;
    }

    This is the second part. It is a continuation of the first part. They are all supposed to be on one file.
    class MyImage implements ImageObserver{
        private int imageUpdateY, imageUpdateW,width,height;
        private boolean imageLoaded;
        private static int currentID = -1;
        private int ID;
        private static Component comp;
        protected ImageProcessor ip;
        private String title;
        protected Image img;
        private static int xbase = -1;
        private static int ybase,xloc,yloc;
        private static int count = 0;
        private static final int XINC = 8;
        private static final int YINC = 12;
        private int originalScale = 1;
        private FileInfo fileInfo;
        ImagePanel win;
        /** Constructs an ImagePlus from an AWT Image. The first argument
         * will be used as the title of the window that displays the image. */
        public MyImage(String title, Image img) {
            this.title = title;
             ID = --currentID;
            if (img!=null)
                setImage(img);
        public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) {
             imageUpdateY = y;
             imageUpdateW = w;
             imageLoaded = (flags & (ALLBITS|FRAMEBITS|ABORT)) != 0;
         return !imageLoaded;
        public int getWidth() {
             return width;
        public int getHeight() {
             return height;
        /** Replaces the ImageProcessor, if any, with the one specified.
         * Set 'title' to null to leave the image title unchanged. */
        public void setProcessor(String title, ImageProcessor ip) {
            if (title!=null) this.title = title;
            this.ip = ip;
            img = ip.createImage();
            boolean newSize = width!=ip.getWidth() || height!=ip.getHeight();
         width = ip.getWidth();
         height = ip.getHeight();
         if (win!=null && newSize) {
                win = new ImagePanel(this);
        public void draw(){
            CenterRect ic = null;
            win = new ImagePanel(this);
            if (win!=null){
                win.addIC(this);
                win.getCanvas().repaint();
                ic = win .getCanvas();
                win.panel.add(ic);
                int width = win.imp.getWidth();
                int height = win.imp.getHeight();
                Point ijLoc = new Point(10,32);
                if (xbase==-1) {
                    xbase = 5;
                    ybase = ijLoc.y;
                    xloc = xbase;
                    yloc = ybase;
                if ((xloc+width)>ijLoc.x && yloc<(ybase+20))
                    yloc = ybase+20;
                    int x = xloc;
                    int y = yloc;
                    xloc += XINC;
                    yloc += YINC;
                    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
                    count++;
                    if (count%6==0) {
                        xloc = xbase;
                        yloc = ybase;
                    int scale = 1;
                    while (xbase+XINC*4+width/scale>screen.width || ybase+YINC*4+height/scale>screen.height)
                        if (scale>1) {
                   originalScale = scale;
                   ic.setDrawingSize(width/scale, height/scale);
        /** Returns the current AWT image. */
        public Image getImage() {
            if (img==null && ip!=null)
                img = ip.createImage();
            return img;
        /** Replaces the AWT image, if any, with the one specified. */
        public void setImage(Image img) {
            waitForImage(img);
            this.img = img;
            JPanel panel = ImagePanel.panel;
            width = img.getWidth(panel);
            height = img.getHeight(panel);
            ip = null;
        /** Opens a window to display this image and clears the status bar. */
        public void show() {
            show("");
        /** Opens a window to display this image and displays
         * 'statusMessage' in the status bar. */
        public void show(String statusMessage) {
            if (img==null && ip!=null){
                img = ip.createImage();
            if ((img!=null) && (width>=0) && (height>=0)) {
                win = new ImagePanel(this);
                draw();
        private void waitForImage(Image img) {
        if (comp==null) {
            comp = ImagePanel.panel;
            if (comp==null)
                comp = new JPanel();
        imageLoaded = false;
        if (!comp.prepareImage(img, this)) {
            double progress;
            while (!imageLoaded) {
                if (imageUpdateW>1) {
                    progress = (double)imageUpdateY/imageUpdateW;
                    if (!(progress<1.0)) {
                        progress = 1.0 - (progress-1.0);
                        if (progress<0.0) progress = 0.9;
    public void setFileInfo(FileInfo fi) {
        fi.pixels = null;
        fileInfo = fi;
    }

Maybe you are looking for

  • How can i get a file object on servlet

    i want to send a file object to be sent on a servlet from html input file tag. This is the HTML code <form action="uploadImage.jsp" method="post"><br><br>             <table width="400px" align="center" border=0 style="background-color:ffeeff;">     

  • Xml xslt and java

    To obtain a HTML form from a xsd (xml schema) I thought I must use a parser to parse the schema and extract field info (how many fields needed and which type) to create the form to add records to a simple XML DB, like: <db> <rec id="0"> </rec> </db>

  • Report template in designer 6i

    Hi How to make a reports template in designer to generate a report with header/footer sections? In a .TDF file, you have only one section, that corresponds to the body section... In previous releases, we used a .RDF as a template, and it could have t

  • POR: Changes on Purchase Order Response after saving

    Hi SRM Gurus, I'm currently working with SRM_SERVER 500(SAPKIBKS09) release, I'm not able to change(or delete) an POR once it has been saved. Normaly as an Purchaser I should be able to do that. Is that a std system behavior. FYI - The following POR

  • Nokia N95 8Gb Calendar alarm default setting

    I have searched high and low here and in the user manual however, have not found the answer to my query, so I hope you will forgive me if this topic has been covered before. I use the Calendar extensively to remind myself of appointments and birthday