Java code to call methods in .ocx file

dear friends,
i have an .ocx file with me which is used to communicate with a specific device.it is an already existing one. i wish to know whether i can call method sin that .ocx file using java .using vb6 we can do this.
if it is possible with java i wish to know how i can do this.please consider this query and please send me your responses. i know that using jni we can communicate with .dll files.but i am not sure about .ocx file. please help me.
thank you
arun

i wish to know whether i can call method sin that .ocx file using java
Probably
db

Similar Messages

  • Best place in VOimpl java code to call a stored proc to populate results

    Hello all,
    Using JDev 11g, ADF BC and Trinidad.
    I am building an application that is primarily used for searching large amounts of data. We already have stored procedures on the database that perform the searches and dump the results into a holding table (together with a "search id"). I have easilly built a prototype of this application: my view object is simply "select a, b, c from results where search_id = :bv" - I have a service method in the AM that runs the stored procedure, obtains the search ID, binds it to the :bv in the VO and executes the VO's query - it's all working really nicely. Range paging is effective, the VO itself performs well, and I am able to control how long the stored proc runs via setting a timeout value.
    Now, I'd like to generalize this. My thinking is this:
    1). I'll add a custom property to my VO that is the SQL statement needed to call the stored procedure.
    2). I'll add some bind variables to the VO to represent all the query parameters that can be passed to the stored proc. I'll also use custom properties to indicate these are "fake" bvs, and not in the SQL query itself.
    3). The VO's SQL will remain simply "select a, b, c from results where search_id = :bv"
    4). I will (have already tested) override bindParametersForCollection so that the "fake" bind variables aren't bound into the SQL.
    Now, the question: I want to override some method in the VO's java code to call the stored procedure. The stored proc needs to be called before the actual query for the VO is run, and also before the method getQueryHitCount is called (so that the count is correct). What is the method that would be the "best" place to do this? My current thinking is that I would put the call in an over-ridden executeQueryForCollection call. As far as my analysis has gone, it seems to be always called before getQueryHitCount, but I have no way of knowing if this is completely safe.
    Any thoughts from the BC experts out there?
    Best regards,
    John

    John,
    from your description I understand that you essentially program the VO yourself. So I suggest that you read chapter 35.9 of the 'Fusion Developer’s Guide for Oracle Application Development Framework' (I guess you know where to find it). Since you still call the actual SQL not all of the chapter apply, but you get the idea how it works.
    And yes you analyzed the behavior correct. executeQueryForCollection() is allways called bevore getQueryHitCount().
    Timo

  • Java code to create a new .txt file in FTP server  --- Help

    Hi,
    I wrote a standalone java app which creates a .txt file in my local machine and transfers it to FTP server. But my requirement now is to create a new .txt file with the same content in FTP server itself instead of creating locally with basic java code.
    I'm aware of transfering file from local machine to the FTP server using STOR command of FTP. But i never tried creating a new file & writing content into that in FTP server.
    So, if any one did this before please help me out with source code or any idea ???
    Thank you.
    Vj.

    simply_vijay wrote:
    thanks for your reply. yes i've seen the Apache Commons NET API , but there is no method or class to create a new file in FTP server. I'm really worried how to solve this problem ???Sure there is.
    There's a method where you can write data to a file on the server using an OutputStream, right? Well, instead of writing to a FileOutputStream, write to that OutputStream instead. Remember to close the OutputStream and call the method which says you're finished with the command (I forget what it's called).

  • Calling method from SWF file wtih javascript, when swf file is not loaded in any browser

    Hi There,
    I have a question regarding flex and javascript integration:
    1. We have created certain components and bundle them in swf. these swf file uses webservice to connect to backend code written in java.
    2. We have deployed swf file and backend on the same tomcat server.
    3. Backend server send some datapoint to UI and plot graph and displyaed to user.
    4. Now if user generate graph from datapoint and want to export it, we are tranferring image of that graph from UI to backend. No issues in this process.
    5. Now the question is. let say user has not open any swf file in browser and backend scheduling job want to generate the graph. How we will connect to swf file.
    6. Is ther any way we can connect or call method of swf from java/jsp/html/javascript code in this scenario without loading swf file in browser??
    Please help me!!!
    Thanks
    Sonu Kumar

    Both test sites work just fine for me.
    The "Update plugin" message is exactly what would be displayed if no .swfobject file at all was found... so it may not be the "version11" thing but rather, perhaps something else is messed up with the .swfobject file.
    File can be found in both folders:
    http://www.pureimaginationcakes.com/test/Scripts/swfobject_modified.js
    http://www.pureimaginationcakes.com/Scripts/swfobject_modified.js
    and file does download when downloading the html page (just check the cache).... but for some reason it doesn't seem to be working.... Hummmmm????
    Adninjastrator

  • Calling method from jsp file

    Hi
    is it possible to call any method with in the class except handle method from jsp file?

    You can call , but it would not be a good design approach.A droplet can do the same task for you.
    otherwise :
    eg :
    <%@ page import="com.mypackage.MyClass"%>
    for Static access :
    <%
    String test= MyClass.myMethod();
    %>
    for normal classes :
    <%
    MyClass object = new MyClass();
    String test= object .myMethod();
    %>
    http://stackoverflow.com/questions/10918526/call-java-method-in-jsp-file
    http://www.javaworld.com/javaworld/jw-05-2003/jw-0523-calltag.html?page=2
    ```
    Praveer
    Edited by: Praveer Rai on Mar 26, 2013 5:08 PM

  • Anything wrong with the code to call method of an external class ??

    I have written this code to invoke metod1 in MethodList.java. :
    import java.io.File;
    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    import com.sun.org.apache.bcel.internal.util.ClassLoader;
    public class RunMthdRef
    public static void main(String[] args)
    URLClassLoader loader = null;
         File file = new File("C:\\Documents and Settings\\227951\\workspace\\Methodcaller\\");
         String classpath = System.getProperty("java.class.path") + System.getProperty("path.separator") + file.getPath();
         System.setProperty("java.class.path",classpath);
         try
    loader = new URLClassLoader(new URL[]{file.toURL()});
         catch (MalformedURLException e)
    // TODO Auto-generated catch block
    e.printStackTrace();
         Thread.currentThread().setContextClassLoader(loader);
         try
              Class B=loader.loadClass("MethodCaller.MethodList");
              Object objectInstance = B.newInstance();
              Method startup =B.getMethod("Method1", null);
    startup.invoke(objectInstance,null);
         catch (Exception e)
              e.printStackTrace();
    I want to invoke the Method1 in this class present in the same project :
    public class MethodList {
         // declaring method 1
         public void Method1()
              Method2();
              Method4();
         // declaring method 2
         public void Method2()
              Method3();
    //     declaring method 2
         public void Method3()
              System.out.println("End of method list");
         // declaring method 4
         public void Method4()
              Method3();
         * @param args
    }

    I have written this code to invoke metod1 in MethodList.java. :Why?
    import com.sun.org.apache.bcel.internal.util.ClassLoader;Why?
         System.setProperty("java.class.path",classpath);That won't work. It's read-only, and too late to set it anyway.
              Class B=loader.loadClass("MethodCaller.MethodList");If 'MethodCaller' is the name of a package you need to study the standard Java coding conventions. Google will find them.
              Object objectInstance = B.newInstance();
              Method startup =B.getMethod("Method1", null);
    startup.invoke(objectInstance,null);Do you really have to do all this reflectively?
    I want to invoke the Method1 in this class present in the same project :If it's in the same project why do you need reflection? and dynamic class-loading?

  • Java code for calling xslt mapping in module?

    Hi,
    We have 2 mapping(xslt) in IR
    source->cannonical and cannonical->target
    we want to remove source->cannonical mapping and want to put that in MODULE of communication channel.
    My problem is how to call xslt mapping using java code and we done value mapping their. Did that vallumapping will work in module..
    waiting for responce..its an urgent task..
    thanq
    krishna

    You can use the MessageTransformBean to run the XSLT in the adapter framework:
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken]
    I do not know, if the value mapping works here. Maybe you just give a try.
    Regards
    Stefan

  • Legacy C program - new Java GUI and calling methods

    Hello,
    I am fairly new to these forums. I've been working for a company that has an exsisting program that is a propriotery video-client to a video-server. It is written in C and has DirectX components for the standalone C application and ActiveX components for the Internet Explorer version.
    I looked over the source code and found a main() function. Now I am trying to execute that main() fuction through java and jni. I have managed to get a simple HelloWorld program to work but am now stuck.
    I would like to do the following.
    1. Convert the exsisting code to a C library. I have to use Visual C++ 6.0 to create this project. (There is already an exsisting dsw project file for the video client).
    Question: How do I get rid of the main() function and compile correctly in Visual C++?
    2. How do I call the library function that I created in the above from a java main() method? What should I use to edit and compile java/c code?
    Thank you,
    Viral

    Hi,
    If you need to have fast results you can try to use the ActiveX with COM bridge like Jawin or JACOb (both at sourceforge) or use Eclipse's SWT that has an activeX support too.
    An other alternative is to create a full JNI wrapper to your project.
    A1 : Replace the main by DllMain (create a new DLL with msvc++ wizard to see how to create a basic DLL).
    A2 : Call all functions exported by DLLs with a free tool like JNative.
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Can java code be called??

    Can method written in java be called from a method written in c++??. that is c++ program can call a java method and how??

    Can method written in java be called from a method
    written in c++??. that is c++ program can call a java
    method and how??The Java Invocation API:
    http://java.sun.com/docs/books/jni/html/invoke.html#11202

  • How to call methods from .mxml file from actionscript file

    I have a Example.as and a Test.mxml.
    In this Test.mxml, I have a function which is something like:
    public function doTest():void
         Alert.show("testing!");
    How do I from example.as call this function doTest() from Test.mxml?
    I tried declaring public var test:Test inside my Example.as but I'm still unable to call that function out.
    Any idea how?

    Hi Bryant,
    You need to create an instance of the component and then attach it to the display list then only you can access the Controls with in your component other wise the controls and components are not created or initialized that's why you are thrown the null object reference error.
    So you need to do somethink like below:
    var myTestObj:Test = new Test();
    this.addChild(myTestObj); //Adds the component to DisplayList(You need to add this line of code in order to avoid the error)
    myTestObj.doTest();
    If you add your component in mxml then the component will be automatically added to the display list and you dont need to add explicitly to the display list.
    <comp:Test id="myTestObj" />
    And now if in your actionscript you call myTestObj.doTest(); no error occurs and you can see the Alert message.
    Thanks,
    Bhasker

  • Can java code be compiled as an o. file and how?

    Some langyages produce o. files during the compiling process. Can Java do that?

    Some langyages produce o. files during the compiling
    process. Can Java do that?No, the Java compiler produces .class files. .o files contain binary
    date to be natively linked into an executable. .class files are loaded by
    the JVM and run by it.
    kind regards,
    Jos

  • Calling a javascript function from java code and getting tha value in Java

    Hi,
    I would like to call a Java script function confirmRemove() from Java code upon meeting a condition..
    for example the code snippet is:
    if(true){
    // I want to call js confirmRemove() over here. And get the value of variable "answer" in this if block.
    <html>
    <head>
    <script type="text/javascript">
    function confirmRemove() {
         var answer = confirm("Are you sure you want to Delete?")
    </script>
    </head>
    <body>
    <form>...

    Hi,
    Back in 2003 I have used an Applet which contain java code and this java code was calling the java scripts ( different methods, DHTML etc..)
    There was a component developed by NetScape called JSObject I am not sure it there is other third party component other then the JSObject
    look at this article which shows how (based on JSObject)
    [http://java.sun.com/products/plugin/1.3/docs/jsobject.html|http://java.sun.com/products/plugin/1.3/docs/jsobject.html]
    Regards,
    Alan Meio
    London,UK

  • Need Java Code or Program to compare 2 XML files ???

    Hi All,
    I need Any java code snippet to compare 2 XML files? Please help me..
    Thanks,
    J.Kathir

    Can you explain which possibilities you rejected while searching for that on the Internet? That may give us some insight into your actual requirements.

  • How to create new java objects in native methods?

    Hello,
    Is it possible to create java objects and return the same to the java code from a native method?
    Also is it possible to pass java objects other than String objects (for example, Vector objects) as parameters to native methods and is it possible to return such objects back to the java code?
    If so how can I access those objects (say for example, accessing Vector elements) inside the native code?
    What should I do in order to achieve them?
    Regards,
    Satish

    bschauwe is correct in that constructing Java objects and calling methods on Java objects from native code is tough and takes some study. While you're at it, you might want to check out Jace, http://jace.reyelts.com/jace. It's a free open-source toolkit that really takes the nastiness out of doing this sort of stuff. For example,/**
    * A C++ function that takes a java.util.Vector and plays around with it.
    public void useVector( java::util::Vector& vector ) {
      // Print out all the contents of the vector
      for ( Iterator it = vector.iterator(); it.hasNext(); ) {
        cout << it.next();
      // Add some new elements to the vector
      vector.addElement( "Hello" );
      vector.addElement( "world" );
    } All this code just results in calls to standard JNI functions like FindClass, NewObject, GetMethodID, NewStringUTF, CallObjectMethod, etc...
    God bless,
    -Toby Reyelts

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

Maybe you are looking for