Can i call java program from VC++ code...... Urgent!
hi,
I have VC++ code.
I want to run java program from VC++ (SDK).
Can I call it?
plz help it's urgent....
thanks in advance...
We do it all the time using the JNI invocation API (this is actually how the java.exe application works).
Here's a tutorial I just found (not sure how good it is, but it should get you going):
http://www.inonit.com/cygwin/jni/invocationApi/
One note: If you are going to be invoking the JVM from different threads in your native app, there is some special handling you will have to do - the above tutorial doesn't address this scenario (a dig through the JNI docs should help with that one, though).
Cheers,
- K
Similar Messages
-
Error while calling java program from ABAP
Hi Experts,
We are trying for RFC inbound scenario.
We followed the below blog
/people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
We are working with SAP JCO 3.0.2
We are getting the error : 'STFC_CONNECTION' could not be found in the server repository.
After I run the Java server program if I execute the RFC destination directly from SM 59 it is showing successful messages.
If I stop the java program then this RFC is failing. Based on this we concluded that RFC to Java connection is working fine.
But as mentioned in blog if we call the RFC Destination from ABAP program it is giving the below error,
'STFC_CONNECTION' could not be found in the server repository.
If we test the RFC destination using RFC_TRUSTED_CHECK standard FM we are getting the below error.
'RFCPING' could not be found in the server repository.
We create the RFC destination of Type : TCP/IP as exactly mention in the blog.
Please help us in resolving this issue.
Thanks
PrincePabi,
Using the RFC connection,we can establish a link between Java and SAP.
Afterwards,hope we can call Java program from ABAP.
Below is the sample piece of code to establish RFC connection(link) between Java and SAP.
DATA: REQUTEXT LIKE SY-LISEL,
RESPTEXT LIKE SY-LISEL,
ECHOTEXT LIKE SY-LISEL.
DATA: RFCDEST like rfcdes-rfcdest VALUE 'NONE'.
DATA: RFC_MESS(128).
REQUTEXT = 'HELLO WORLD'.
RFCDEST = 'JCOSERVER01'. "corresponds to the destination name defined in the SM59
CALL FUNCTION 'STFC_CONNECTION'
DESTINATION RFCDEST
EXPORTING
REQUTEXT = REQUTEXT
IMPORTING
RESPTEXT = RESPTEXT
ECHOTEXT = ECHOTEXT
EXCEPTIONS
SYSTEM_FAILURE = 1 MESSAGE RFC_MESS
COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
IF SY-SUBRC NE 0.
WRITE: / 'Call STFC_CONNECTION SY-SUBRC = ', SY-SUBRC.
WRITE: / RFC_MESS.
ENDIF.
Regards,
Sree -
Calling Java program from ABAP
Hi All,
my ABAP program downloads one file to one folder. Then one Java program is running to Encrypt the file.
Now , they want to call the JAVA program in ABAP, so that they can encrypt the file before downloading.
Is it possible to call a Java program from ABAP ? If Yes, please give me the detailed procedure.
Thanks
pabiPabi,
Using the RFC connection,we can establish a link between Java and SAP.
Afterwards,hope we can call Java program from ABAP.
Below is the sample piece of code to establish RFC connection(link) between Java and SAP.
DATA: REQUTEXT LIKE SY-LISEL,
RESPTEXT LIKE SY-LISEL,
ECHOTEXT LIKE SY-LISEL.
DATA: RFCDEST like rfcdes-rfcdest VALUE 'NONE'.
DATA: RFC_MESS(128).
REQUTEXT = 'HELLO WORLD'.
RFCDEST = 'JCOSERVER01'. "corresponds to the destination name defined in the SM59
CALL FUNCTION 'STFC_CONNECTION'
DESTINATION RFCDEST
EXPORTING
REQUTEXT = REQUTEXT
IMPORTING
RESPTEXT = RESPTEXT
ECHOTEXT = ECHOTEXT
EXCEPTIONS
SYSTEM_FAILURE = 1 MESSAGE RFC_MESS
COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
IF SY-SUBRC NE 0.
WRITE: / 'Call STFC_CONNECTION SY-SUBRC = ', SY-SUBRC.
WRITE: / RFC_MESS.
ENDIF.
Regards,
Sree -
Calling Java programs from Oracle Stored Procedure
Is it possible to call Java programs from Oracle stored procs? If possible Can this be used to exchange data from other applications? Is there a better method/feature in oracle for doing data exchange with other apps?
If what you mean by Oracle stored procedures is pl/sql then yes.
You can create a "wrapper" this way:
CREATE OR REPLACE FUNCTION xmlXform
in_mapUrl IN VARCHAR2,
in_inputUrl IN VARCHAR2
RETURN VARCHAR2
AS
LANGUAGE JAVA NAME
'com.yourcompany.xml2any.xform(java.lang.String,java.lang.String)
RETURN java.lang.String';
Then load the java as:
loadjava -user youruser/youruserpasswd -resolve -verbose lib/xmlparserv2.jar classes/com/yourcompany/xform.class classes/com/yourcompany/xml2any.class
The java, given the correct permissions, can do anything java can do including communicate with outside applications.
Is this the "best" way... depends on what you are trying to accomplish. -
How to call java program from ABAP
Hi Experts,
My requirement is to call java programs from ABAP. For that i have set up SAP JCO connection by using this link http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/739. [original link is broken] [original link is broken] [original link is broken] Connection gets sucessfully. After this how to call java program from ABAP as per our requirement. Please help me out.
Also i tried this way also.. but while executing the DOS Command line appear & disappear in few seconds. So couldnt see the JAVA output. Please help me out to call java programs in ABAP..
DATA:command TYPE string VALUE 'D:Javajdk1.6.0_20 injavac',
parameter TYPE string VALUE 'D:java MyFirstProgram'.
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application = command
parameter = parameter
OPERATION = 'OPEN'
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
OTHERS = 8.
Thanks.This depends on the version of your Netweaver Java AS. If you are running 7.0, you will have to use the Jco framework. The Jco framework is deprecated since 7.1 though. If you want to build a RFC server in 7.1 or higher, it is adviced that you set it up through JRA.
Implement an RFC server in 7.0:
http://help.sap.com/saphelp_nw04/helpdata/en/6a/82343ecc7f892ee10000000a114084/frameset.htm
Implement an RFC server in 7.1 or higher:
http://help.sap.com/saphelp_nwce72/helpdata/en/43/fd063b1f497063e10000000a1553f6/frameset.htm -
Can we call java jar from ODI?
Hi All,
Can we call java jar from ODI? if yes please suggest how?
Regards,
SatishThis is an excellent article from Uli.
One reason, I dont like this approach is that is mandates to copy the .jar file to the driver folder and restart the agent.
Think of a scenario where there are several developers in love with Java and want to place the jars in the drivers directory.
This is a maintenance nightmare for the admin and would clutter up the drivers directory.
Find here the way to invoke Java jar methods
http://askankit.blogspot.com/2010/09/call-java-jar-methods-from-odi.html -
Calling java program from PL/SQL code
Dear,
How to develop and call a java program from PL/SQL code?
What about if this program will call other java programs?Perhaps the Java Developer's Guide would be a good place to start
http://download.oracle.com/docs/cd/B19306_01/java.102/b14187/toc.htm
Justin -
Call Java Program from ABAP Program
Dear all,
In our scenario, we need to let ABAP call services provided by a standalone Java program. From online help I found some overview introduction and I'd make the called program a registered program in a RFC with type "T" (TCP/IP Connection). Can anybody give some concrete documentation? A step-by-step guide would be greatly appreciated.
Best Regards
Jeromecheck this thread
Re: Calling Java API from ABAP using JCo -
How to call java program from javascript
Hi,
I have an java program which will transform one xml to another xml using XSLT.
I want to call this java program from Javascript? Is this possible? Please suggest me.
Thanks,
Gopalis it not possible?
do i have to refresh the page and read in the values like...
<%
String ename = request.getParameter( "EmployeeName");
session.setAttribute( "ename", ename);
%>and then call the class from here?
looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
is ajax better or not really worth it?
i have anything up to 100 fields that need saving at one save click -
Can we call Java class from LiveCycle Process?
hi..
I have a general query, is it possible to call customeized java class from Workbench Process?
I found dat we can invoke a web service... is there some operation like that for calling a java class...
Thanks and Regards,
AmbikaYes.
You can use the Script service and put your Java code in there
Or build your own component, which is really a Java pojo, and deploy it to LiveCycle. See http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000934.html.
Jasmin -
Calling Java Services from ABAP code
Hi,
How to call Java services (not web service) from ABAP code?
I have a requirement where JAVA team has developed some services that can be called from URL or from a Java application.
Ex: when this URL is executed,
http://localhost:8080/artemis7_802/triton/mycompany.remoteFunctions.RequirementsList.a7x?requestid=3023&requestname=I6PRAO1&skill=SAP&skill=JAVA
It returns a XML file on browser.
And I have no idea about the 2nd way i.e. from Java application!
Now, how can ABAP call these java methods?
I heard that something can be done via maintaining RFC destinations in SM59 to call Java services? Can this be done with my requirement?
Please help.
Thanks and regards,
AmeyPosted it in WD ABAP forum.
-
Calling java program from PL/SQL
I already have a java program that encrypts/decrypts data.
How can I use or rather call this program in PL/SQL?Please refer [url http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14261/subprograms.htm#sthref1814]Calling External Subprograms on PL/SQL User's Guide and Reference.
-
Getting error when calling Java program from JSP page.
Hi All,
I'm getting below error msg, previously the page use to display and also java program use to run properly, but suddenly today i came across this error. May be some settings have been changed on my server, since number of developers uses this common webserver here.
Any help would be much appreciated. Pls let me know if if anyone requires much info regarding this one.
javax.servlet.ServletException: sun/tools/javac/Main
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.(Compiled Code)
at java.lang.Exception.(Compiled Code)
at javax.servlet.ServletException.(Compiled Code)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.doService(Compiled Code)
at org.apache.tomcat.core.Handler.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.service(Compiled Code)
at org.apache.tomcat.facade.RequestDispatcherImpl.doForward
Root cause:
java.lang.NoClassDefFoundError: sun/tools/javac/Main
at org.apache.jasper.compiler.SunJavaCompiler.compile(Compiled Code)
at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(Compiled Code)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(Compiled Code)
at org.apache.jasper.servlet.JspServlet.loadJSP(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(Compiled Code)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
Message was edited by:
shukla_arvinddid u happen to upgrade ur jdk?????
-
Can't run Java Programs from home computer
Hi, sorry if this is a simple problem.
I downloaded Java version 1.4.0_03 but can't get it to work. I have configured the PATH variable and the CLASSPATH but it isn't working.
If I type java -version the right stuff comes up.... so where have I gone wrong?
Any ideas much appreciated
Thanks
catI downloaded JDK
this is whats in the PATH variable:
;C:\Program Files\Java\j2re1.4.0_03\bin
and in the CLASSPATH:
.;C:\Program Files\PhotoDeluxe HE 3.0\AdobeConnectables;C:\Program Files\Java\j2re1.4.0_03\lib\tools.jar -
Calling java program in bipublisher
Hi,
Like we have datamodel types in BIPublisher as SQL Query, Webservice, Answers, File etc,, Can we call java program through bipublisher.
The requirement is:
A java program will generate BARCODE image based on the customer number given.
We need to create a template in bipublisher which shows the customer name and that barcode image and other details.
We have calling javaprograms in ibots in analytics, is there any such thing in bipublisher.
Thanks.You can call PL/SQL programs from OWB either by defining transformations or as expressions. From PL/SQL you can call a java stored procedures in the database as follows:
1. Define the java stored procedure. For example, let's suppose that you store the following Java class in the database:
import java.sql.*;
import oracle.jdbc.driver.*;
public class Adjuster {
public static void raiseSalary (int empNo, float percent)
throws SQLException {
Connection conn = new OracleDriver().defaultConnection();
String sql = "UPDATE emp SET sal = sal * ? WHERE empno = ?";
try {
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setFloat(1, (1 + percent / 100));
pstmt.setInt(2, empNo);
pstmt.executeUpdate();
pstmt.close();
} catch (SQLException e) {System.err.println(e.getMessage());}
2. The class Adjuster has one method, which raises the salary of an employee by a given percentage. Because raiseSalary is a void method, you publish it as a procedure using this call spec:
CREATE PROCEDURE raise_salary (empno NUMBER, pct NUMBER)
AS LANGUAGE JAVA
NAME 'Adjuster.raiseSalary(int, float)';
3. Call procedure raise_salary from an anonymous PL/SQL block, as follows:Long postings are being truncated to ~1 kB at this time.
Maybe you are looking for
-
How to converrt files on RAW devices in ASM to non ASM file system.
Hi all, I have on problem . Is that possible to migrate ASM raw files system to non ASM file . If possible plzz describe them. If not also please tell y not? Thanks in addvance Regards Krishna
-
I can't uninstall Lightroom 3.2
I am trying to uninstall Lightroom 3.2 but get an error message "error 2753 lightroom.exe is not marked for installation" I have a new pc windows 7 64 bit professional, but had no problem uninstalling from old pc (same Spec). How do I uninstall? I h
-
I was looking at using some snippets from the Java demo apps, and found a couple of problems. #1 -- The app must be used from a base directory. If you are in a higher director it will throw errors because "this.destFile" isn't used except when define
-
How to make an irrelative person able to see the process flow?
A manager asks his/her secretary to help him/her fill a form,which results that the manager isn't involved in the process.But the manager wants to trace the progress of the process.How should I do?
-
Need to get sequence value in another column in oracle
Hi ALL, I have sql query as below select header_id,order_number from oe_order_headers_all. and data it is displaying as heder_id order_number 111 500001 121 500400 I need to display another field with some sequence value li