RFCLIB access from Perl / Java  - newbie question

Hi folks,
I am newbie with SAP. I am triying to access the SAP from my web application, wrote in PErl or JAva.
I am trying to access the librfc, bit I would like to know:
1) What software I need to install in my client side (the web server that host my web application)??
2) Which software contains  the RFC SDK? or the RFC LIB?
3) Should I runt the script to access the rfclib in the SAP server side???
Please help me with this cruel doubt !!!

Hi,
download the SAP JAVA Connector (SAP JCO) from
service.sap.com
There are enough examples for java.
Best Regards
Frank

Similar Messages

  • Accessing oracle DB from a java program - question for oracle driver

    Hi,
    I have Oracle 10 G under vista on my desktop. I am trying to write a simple java program to access/update database tables. I saw in one of oracle example to import 2 packages - namely --- import oracle.jdbc.driver.*; import oracle.sql.*;
    Where do I find these 2 packages. Also I read some documentation to download drivers. I would like to use 2 drivers, the thin driver and the OCI driver. Can someone tell me where I can find these drivers and where do I copy these two drivers - so javac and java command can recognize it.
    I will greatly appreciate the help. Julia
    My program is as follows
    (It was working few years ago but things have changed now and I have Vista because my old machine died):
    import java.sql.*; // JDBC package
    //import com.inet.tds.JDBCRowSet;
    import java.util.*;
    import oracle.jdbc.driver.*;
    import oracle.sql.*;
    public class HomeDB
    run as follows:
    C:\Documents and Settings\MMM>cd \jj
    C:\john>set CLASSPATH=.;c:\oracle9i\classes12;%CLASSPATH%
    C:\john>javac HomeDB.java
    C:\john>java HomeDB
    King: 24000.0
    Kochhar: 17000.0
    De Haan: 17000.0
    Hunold: 9000.0
    Ernst: 6000.0
    Austin: 4800.0
    public static void main(String[] argv)throws SQLException
    Connection conn=null;
    try // may throw a SQLException
    conn = getConnection();
    doQuery (conn);
    catch (SQLException e)
    System.err.println(e.getErrorCode() + ": " + e.getMessage());
    finally // make sure the connection is closed
    if (conn != null) try {conn.close();} catch (SQLException e) {};
    //out.close(); // close PrintWriter stream
    private static Connection getConnection() throws SQLException
    String username = "scott";
    String password = "tiger";
    String url = "jdbc:oracle:thin:@localhost:1521:newora";
    // "jdbc:oracle:thin:@localhost:1521:COCKYJOB";
    Connection conn = null;
    String driver = "oracle.jdbc.driver.OracleDriver";
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    } catch ( ClassNotFoundException cnfex ) {
    System.err.println(
    "Failed to load JDBC/ODBC driver." );
    cnfex.printStackTrace();
    }catch (Exception e){
    e.printStackTrace();
    //DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    conn = java.sql.DriverManager.getConnection(url,username,password);
    conn.setAutoCommit(false);
    return conn;
    private static void doQuery (Connection c) throws SQLException
    // statement to be executed
    String query = "SELECT ename, job, mgr FROM EMP";
    Statement st = null;
    ResultSet rs = null;
    try // make sure the close statements are executed (in the finally block)
    // create the statement
    st = c.createStatement();
    // execute the query
    rs = st.executeQuery(query);
    // process results
    while (rs.next())
    // get the employee last name
    String eName = rs.getString("ename");
    String eJob = rs.getString("job");
    String eMgr = rs.getString("mgr");
    System.out.println("Emp Name:" + eName +
    "Job: " + eJob +
    "MGR: " + eMgr);
    finally // make sure the close statements are executed
    // close the result set if it exists
    if (rs != null) try {rs.close();} catch (Exception e) {};
    // close the statement if it exists
    if (st != null) try {st.close();} catch (Exception e) {};
    Edited by: user455788 on Dec 19, 2008 9:13 PM

    You can download the drivers from http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html.
    Note that oracle.jdbc.driver is desupported after 10.2, http://forums.oracle.com/forums/ann.jspa?annID=201, so you might want to consider using a DataSource to provide Connections.
    E.G.
    {message:id=2819114}

  • Questions from a Java newbie

    Okay, here's my situation:
    I'm fairly new to Java, but I've done some fairly basic client-side java. However, I haven't done any server-side java stuff before, and I don't know what special considerations I 'll have to make, etc. And I don't really know how to do the things I'm asking about below:
    What I want to do is this:
    1) Grab the Computer Name and Company Name from a computer when the user loads a webpage. This then needs to be stored in a server-side database.
    2) Password protect a webpage, so that only users who enter the correct username/password can view it. I presume the username/password data will also be stored in a server-side database.
    Now, I'm really not sure how to do this, and I'd like at least a few pointers on how to go about it. In fact, any help at all would be appreciated.
    Adrian Forest - Java Newbie

    Actually, any sample code you could give, even showing just one possible solution, would be greatly valued.
    Also, I really don't know how server-side java works, as far as where I have to run these actions. Can I have some server-side code that reads the data from a client? Or do I need a client-side piece that reads data, then sends it to the server-side code that then writes that data to the database?

  • Database access from Oracle Java Cloud Service application

    I have registered for Oracle Java Cloud Service for trial period. I want to deploy a Spring MVC 3.2 and Hibernate 4.0 web application.
    I created a table in the Database Cloud. I am not sure how do I access the Database Cloud Service from my application.
    Need your guidance/pointers/references that can help me establish connection from my application to the database.
    Thanks,
    Ujjwal

    Hi,
    Use JPA - see the visitors example, it uses @PersistenceUnit injection with previously weaved .class entity files.
    You can use application managed EMF's and EntityManagers with code like the following - which is not preferable to using @PersistenceContext injection on an @Stateless session EJB but...
              EntityManagerFactory emf = Persistence.createEntityManagerFactory("JPAServletPU");
              EntityManager em = emf.createEntityManager();
              EntityTransaction transaction = null;
              try {
                   transaction = em.getTransaction();
                   transaction.begin();
                   Visitor entity = new Visitor();
                   entity.setName(name);
                   entity.setNum(num);
                   em.persist(entity);
                   transaction.commit();
                   System.out.println("Committing: " + entity);
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   em.close();
                   emf.close();
    Use a persistence.xml like the following
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="JPAServletPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
         <!--https://cloud.oracle.com/mycloud/f?p=5300:1000:259334829915901-->
    <jta-data-source>database</jta-data-source>
    <class>com.vision.cloud.jpa.Visitor</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
         <property name="eclipselink.target-database" value="Oracle10g" />
    <property name="eclipselink.ddl-generation" value="create-tables"/>
    <!-- property name="eclipselink.ddl-generation" value="drop-and-create-tables"/-->
    </properties>
    </persistence-unit>
    </persistence>
    Check out a tutorial on WebLogic JPA ORM usage here to get started as well.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial

  • Java Newbie Question - the import statement

    Hi Geeks,
    I have a problem for importing a java .class in my project. This latter is named "Tedetis_New". Inside it, I created a "src" folder containing all the source code of the application. I import a jar file inside the parent directory of "src" (i.e. at the root of the project). Inside this jar archive, two classes (.class files) are not placed inside a package (default package according to eclipse), let's name one toto.class. So when I want to import toto.class from a file inside the src directory I simply do "import toto.class" but this statement doesn't work ! I don't manage to import my toto.class so ... what do you propose for this ?
    Thanks.

    Don't use the "default" class for anything serious;
    you can't import such a class.Er, package maybe?Yes, I was editing my reply while you replied to my reply so I couldn't
    edit my little blooper in my reply anymore; thank you very much Sir ;-)
    kind regards,
    JosI entered that response as quickly as I could, for just that reason. I
    thought you might notice and try to correct it, and I wanted to preserve
    your fuckupus maximus for all eternity.
    Everyone gather round and taunt Jos! Wave your private parts at his
    auntie! Fart in his general direction!
    Now, aren't you glad you didn't say "Jehovah"?I already knew that you were the one who invented amiability ;-)
    kind regards,
    Jehov^H^H^H^Hos

  • Java newbie questions...Setting the classpath in Unix

    When you set the classpath, how do you include anything already in the classpath? For instance, if your profile sets your classpath to
    "/home/weblogic/:home/weblogic/weblogic.jar, and you want to add MyJar.jar to it, can you enter:
    export classpath=~:MyJar.jar
    My question really boils down to how do you prefix the existing CLASSPATH environment variable to any new classes or jars you want to add to it. I think it's the tilde, but I'm not sure.

    In csh, the CLASSPATH environment variable is modified with the setenv command. The format is:
    setenv CLASSPATH path1:path2
    In sh, the CLASSPATH environment variable can be modified with these commands:
    CLASSPATH = path1:path2:...
    export CLASSPATH
    ====
    (From the Sun documentation)
    or, in sh,
    export CLASSPATH=path1:path2
    should work

  • Visio like object drawing in Java - newbie question

    Hi all,
    Although a reasonably experienced java programmer I am new to the world of 2D graphics.
    I am contemplating writing a tool which includes a diagramming capability for displaying computer systems and interactions between them.
    I guess this would not be a million miles from what a UML diagramming tool does, but it would definitely have some differences.
    So, for example, in this tool a user would be able to:
    Define a computer system and allocate an icon for it.
    Drag that system icon onto a diagram.
    Draw lines between systems and to represent interactions and define what those interactions were.
    Does anyone know if there are any Java API's or tools out there which could get me started?
    Thanks in advance, Robin.

    wpafbuser1 wrote:
    Go fly a kite, Troll. OP said he was new and wanted to know which Java API's to use for 2D graphics. Moreover, there are no Java-related API's with diagramming capability. He can Google for that anyway.He's not new to java as he has stated that he is a "reasonably experienced java programmer". He also knows that he will probably need Java2D else he wouldn't be in this forum. If he is reasonably experienced, there's no doubt that he knows about Swing and how it can be used to create GUIs.
    To the OP, you could try to roll your own Visio like flowcharting program through Java2D and Swing, but you will probably get up and running faster if you use tools already created for this purpose. One such is JGraph ^1^. There are probably others as well.
    ^1^ http://www.jgraph.com/

  • Threads in Java: Newbie question

    Hi
    I had a doubt regarding Threads. I have implemented a Security Manager which does not allow a thread to write into a file. Now, the problem is when the thread tries to write into a file, the Security Manager calls my function in which I want to immediately terminate the thread. How do i do this? How do I terminate a thread without using the deprecated Stop() function ?
    Thanks in advance
    RG

    The trick is to make the thread die a natural death... One method is have a boolean somewhere which is initially set to true (maybe call it keepRunning?), and the thread that should die have a while loop which periodically checks to see that this boolean is still true.
    The function which should terminate the thread can now set that variable to false and force the thread to die at the next iteration of its while loop.
    There are more examples, more methods, and probably a better explanation at:
    http://java.sun.com/docs/books/tutorial/essential/threads/lifecycle.html
    Good luck!

  • Another java newbie question:  "Link errors"

    In the environments I've attempted compiling in, it seems that there is a just-in-time default, which means that any missing classes are not found until run time.
    Is there any way to to run javac so that what we used to call "link errors" will be displayed at compile time?

    Java has no .h files, so it shouldn't compile at all if a class is missing, unless:
    Someone compiles class Library, they have class Extension available
    They give you Library
    You compile, javac sees theat "Library" exists and checks no further
    At run time, you get errors about Library needs missing class "Extension"
    What class is missing anyhow?

  • Java newbie question

    Hi,
    I have the following code:
    public class Dice {
    public static void main(String []arg){
    Scanner scan = new Scanner(System.in);
    Random ran = new Random();
    public void RollDice(){
         ran.nextInt();
    public int returnDice(){
         return ran.nextInt();
    }And the compiler yells at me that it can't find the symbol variable ran.
    If you create an instance of Dice how would you call it in the methods?

    Gimli wrote:
    Hi,
    I have the following code:
    And the compiler yells at me that it can't find the symbol variable ran.
    If you create an instance of Dice how would you call it in the methods?
    public class Dice {
      private Scanner scan;
      private Random ran;
      public Dice() {
        scan = new Scanner(System.in);
        ran  = new Random();
      public static void main(String []arg) {
        Dice dice = new Dice();
        dice.RollDice();
        dice.returnDice();
      public void RollDice() {
        ran.nextInt();
      public int returnDice() {
        return ran.nextInt();
    }OR
    public class Dice {
      public static void main(String []arg) {
        RollDice(new Random());
        System.out.println(returnDice(new Random()));
      public static void RollDice(Random ran) {
        ran.nextInt();
      public int returnDice(Random ran) {
        return ran.nextInt();
    }Just a few ideas to think about.

  • Word access from Java

    Were can i information find?
    Word access from the Java programm.
    Bulj

    Be more specific if you could. Do you want to open up Microsoft Word from Java?
    jmschrei

  • Deploying a VB dll using some web service and accessing it through java

    I'm new to Web Services Based Programming. I would like to know whether this is possible and if so has anyone tried it. I want to create a vb dll that contains the remote methods that the client will access from a java program. After going thru a lot of articles, I'm still unsure on how to do this. I found one method was to Create a VB program/dll, deploy it in a web service and create the java program that accesses by another web service.
    I'm doing this as part of my lab syllabus. The thing is My lab exercises do not state anything about the technologies that I can use to do this.
    This is all that is stated there:-
    Creation Of DLL Using VB And Deploy it in Java
    I just cant get any ideas other than deploying both the parts as web services. If anyone has Better ideas for this, I would really appreciate it.
    I dont know anything about CORBA for languages other than Java and I'm already using the servlets and EJB's in my normal life. I'm also learning the ORB based programming in java. Therefore your help will probably help me learn something new then what I know.

    Sorry I wasn't too specific in my last question.
    This is my java class calling the native method print
    //HeyWorld.java
    class HeyWorld {
    private native void print();
    public static void main(String[] args) {
    new HeyWorld().print();
    static {
    System.loadLibrary("HeyWorld");
    In this case, my C method for calling a C++ method: HelloWorld.cpp
    #include "jni.h"
    #include "stdio.h"
    #include "stdafx.h"
    #Include "HeyWorld.h" //this is where i get my function prototype
    #include "Test.h" //this is the C++ header where the print method and the Test class is
    JNIEXPORT void JNICALL
    Java_HeyWorld_print(JNIEnv *env, jobject obj)
    CTest a; //CTest is the print class I created
    a.print();
    //This is the header for Test.h
    class CTest: public CWinApp
    public:
         CTest(); //constructor
         void print(); //our method
    //And this is the implementation of the class Test.cpp
    void CTest::print()
         printf("Hey World!\n");
         return ;
    I could compile the Test.cpp, HeyWorld.cpp successfully. However when I tried to compile HeyWorld.cpp using
    cl -I<path of jdk include> -I<path of jdk include win32> -LD HeyWorld.cpp -FeHeyWorld.dll,
    the VC++ 6.0 compiler gave me this error:
    HeyWorld.obj:error LNK2001: unresolved external symbol "public:_thiscall CTest::CTest(void)"
    HeyWorld.obj:error LNK2001: unresolved external symbol "public:_thiscall CTest::print(void)"
    Thanks for the help.

  • Variable accessibility: newbie question

    My next newbie question:
    The following two classes are in two separate files in the same a folder testClass2:
    package JavaDemos.testClass2;
    import java.awt.*;
    public class Sketcher {
        static SketchFrame window;
        static int widthXXX;
        public static int getwidthXXX() {
            return widthXXX;
        public static void main(String[] args) {
            window = new SketchFrame("Sketcher");
            widthXXX=1000;
            System.out.println("output: width = " + widthXXX);
            window.setVisible(true);
            window.specialReport();
    package JavaDemos.testClass2;
    import javax.swing.*;
    public class SketchFrame extends JFrame {
        public SketchFrame(String title) {
            setTitle(title);
            setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        public void specialReport(){
            System.out.println("number " + widthXXX);
            //     System.out.println("number " + Sketcher.getwidthXXX());
    }They don't compile.
    I get the following error message:
    JavaDemos/testClass2/SketchFrame.java [23:1] cannot resolve symbol
    symbol : variable widthXXX
    location: class JavaDemos.testClass2.SketchFrame
    System.out.println("number " + widthXXX);
    ^
    1 error
    Why isn't widthXXX directly accessible from SketchFrame?
    Thank you again in advance for any help.

    Why isn't widthXXX directly accessible from
    SketchFrame?Because it's a class variable of another class. You have to refer to it as Sketcher.widthXXX.

  • Accessing env-entry value from a java class

    Hi,
    I have my env-entry element declared in ejb-jar.xml like this
    <env-entry>
    <env-entry-name>ConfigFile</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>centaur</env-entry-value>
    </env-entry>
    and if I access that value from the EJB of that ejb-jar.xml, it is giving the right value. But when I am trying to retrieve the same from a java class, that is throwing exception "javax.naming.NameNotFoundException: Unable to resolve 'ConfigFile' Resolved ; remaining name 'ConfigFile'"
    I think this is because env-entry has access to only EJB to maintain security?
    or can env-entry elemenets cab be accessed outside the EJB and some thing I am doing wrong here?
    can some one help me here?

    Hey Frank,
    The JCo, DI API and DB are all on PL 18. I have found that the error only occurs for one business partner, and that business partner had a service contract added to it the day before the error started to occur. Also the business partner in question is the only business partner with a service contract which would explain why it is the only one experiencing these problems. It could be a coincidence but I will let you know what the outcome is.
    Carla

  • Help me which JNDIFactory to use to access EJB from a java class of JAR

    I am confused in understanding the different JNDI factories
    RMIInitialContextFactory, ApplicationInitialContextFactory and ApplicationClientInitialContextFactory
    And the different namespaces like global, container local and component local.
    Especially is there any relationship between the JNDI factories and the namespaces?
    Or are they related to the deployment descriptors.
    Because in application specific deployment descriptors (orion-ejb-jar.xml), we just map the JNDI location with the object (or its reference from ejb-jar.xml). We dont specify it can be accessed from this factory or that.
    Shall we access an EJB from using any JNDI factory?
    Specifically, I am stuck with what Factory to use to access an EJB from a Java class in a library (jar). The JAR is packaged with the EAR which contains the EJB Jar that I am trying to access.
    THANK YOU

    Ed,
    As Robin said, I think you need code similar to this:
    Context c = new InitialContext();
    Object o = c.lookup("java:comp/env/Name");where Name is the name of your EJB as it appears in the "ejb-jar.xml"
    deployment descriptor XML file.
    Good Luck,
    Avi.

Maybe you are looking for

  • Logic node 9.0 update

    Is there a update for Logic 9.0 node? This is used when you have multiple computers on the same network. I am currently running Logic pro 9.1.5 and the node does not work. I went back and open logic 9.0 and the node worked. Need update for Logic Node

  • One of the pages I am working on is blocked and I cannot delete/change items displayed there

    One of the pages I am working on is blocked and I cannot delete/change items displayed there. I have unlocked all the layers but still cannot access the content on that page. Thoughts?

  • Retrieve elements that fail validation

    Hi.. I've succeeded in parsing an XML string with schema validation. For my app I need to get a reference to the element that triggered a SAXException. How do I obtain a reference to that node. Could I in a simple way create simple contenthandler ext

  • Running a Excel VBA Addin from Applescript

    Hi, I have created a VBA script in Excel 2011.  I want this scripot to be availbale to any workbook I open up in Excel so I have set the script as an Add-in.  Then I want to be abke to run this script from Applescript.  The final plan is to have an a

  • Where does an abap program get stored after save?

    Where does an abap program get stored after save? ...plzz tell Edited by: Alvaro Tejada Galindo on Feb 18, 2008 11:28 AM