How to use a Java Resource in my java source

Hello,
I need to know how to use my external JAR I loaded in the database using this line below:
CREATE OR REPLACE JAVA RESOURCE NAMED "MyJar" USING BFILE (BFILE_DIR,'MyExternal.jar');
In fact, I have a Java file using this JAR, but I do not know how to tell to the java source that it have to use this JAR.
==========Java Source importing the Jar===================
package com.gemalto.ws.snmp;
import java.io.IOException;
import java.util.Vector;
import org.snmp4j.Snmp;
import org.snmp4j.smi.*;
import org.snmp4j.TransportMapping;
import org.snmp4j.transport.DefaultUdpTransportMapping;
import org.snmp4j.CommunityTarget;
import org.snmp4j.mp.SnmpConstants;
import org.snmp4j.PDU;
import org.snmp4j.event.ResponseEvent;
public class SNMPAgent
==========================
Could you give the SQL request or loadjava command line permitting to do use my java resource file?
Thks

The JAR is already load by using CREATE JAVA RESOURCE ... or "loadjava -resolve –force -user p/p@SID –genmissing -jarasresource MyJar.jar"
If we can create a resource by SQL or loadjava, how can I use it in my java code?
Edited by: 847873 on 28 mars 2011 06:05
Edited by: 847873 on 28 mars 2011 06:07

Similar Messages

  • 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

  • How to use xliff as resource bundle ?

    I used to do Java i18n as following base on resource bundle in properties file format:
    Locale myLocale = new Locale("es", "ES");
    ResourceBundle bundle = ResourceBundle.getBundle("HelloResourceBundle", myLocale);
    System.out.println(bundle.getString("Hello"));I realized that there is new bundle called xliff like:
    <trans-unit id="Hello">
    <source>Hello how are you</source>
    <note>This is message to say hello</note>
    </trans-unit>Does java resource bundle support xliff file similar to properties file? if not, could anybody give an example how to handle xliff file?
    Thanks

    Following code worked for me:
    import oracle.javatools.resourcebundle.BundleFactory;
    import java.util.ResourceBundle;
    * This method retrieves localized strings from a given XLIF resource bundle.
    * @param bundleName The XLIF bundle from which the localized string is to be retrieved.
    * @param key The key of the localized string.
    * @return The localized string retrieved from the given XLIF bundle.
    public static String getXlifLocalizedString(String bundleName, String key) {
    if (StringUtils.isEmpty(key)) {
    return key;
    if (StringUtils.isEmpty(bundleName)) {
    return "[" + key + "]";
    String localizedString = null;
    ResourceBundle resourceBundle = null;
    try {
    resourceBundle = BundleFactory.getBundle(bundleName);
    localizedString = resourceBundle.getString(key);
    } catch (Exception e) {
    LOG.log(Level.SEVERE, "Problem in loading XLIF resource bundle: " + bundleName, e);
    return "[" + key + "]";
    return localizedString;
    }

  • How to use of ffmpeg or jffmpeg with java

    I am creating an application in java to convert one video format to other. (eg. avi to wmv) . as JMF does not support all the video formats available today. I read on the net that I can use ffmpeg or jffmpeg together with jmf to process many video formats. but i did not get any example or guide to use ffmpeg with java. Can you plese guide me how to use this libraries with jmf. with some example or simple steps to integrate ffmpeg with jmf.
    I am using java 1.6 and jmf 2.1. eclipse IDE and windows xp professional and redhat linux.

    Can you plese guide me how to use this libraries with jmf. No.
    This is a JMF forum. 3rd party stuff like ffmpeg is not supported here.

  • How to use a VB dll file in java

    hi,
    i am working on college project,In this output of calculation is not matching with college site .So any one can tell "how to use or combine a VB 'dll' file in java?".so that i can use VB 'dll' file in java to get right Output.
    If possible write code or send it to "[email protected]"
    Thanks
    Ravi kapani

    Did you try Google? And no, there is no native support for accessing .dll files from Java. That said, take a look at JNI.

  • How to use chart engine for web dynpro java(EP) for Graphics generation.

    Hi Frndz..
    now lookiing out for different types of dynamic graphics generations according to my requirment, n i saw the followiing blog
    Testing BusinessGraphics in Web Dynpro for Java
    Itz very nice to see that we can generate planty of types, but here our server is EP 7.0(not CE 7.1) and i gone thru  these links also
    http://help.sap.com/saphelp_nwmobile71/helpdata/en/86/243f403f0a9354e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nwmobile71/helpdata/en/0b/79553b066d9414e10000000a114084/frameset.htm
    https://help.sap.com/saphelp_nw04/helpdata/en/0c/95c83956852b51e10000000a114084/frameset.htm
    here it seems to be Chart Engine n Chart Designer is mainly for BSP(R3), how best we can use this for web dyn pro java.
    Thanks in Advance
    Regards
    Rajesh

    hi
    if you want to use BusinessGraphics in WebDynpro java you have to configure IGS.
    IGS Configuration
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/4846ac90-0201-0010-099d-d3b4e271849c
    Business Graphics docs.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3261cd90-0201-0010-268c-d8d72e358af6
    ChartDeigner Usage
    http://help.sap.com/saphelp_nw04/helpdata/en/18/d4d43fb9490c65e10000000a114b1d/frameset.htm
    Generating Gantt chart using web dynpro business graphics

  • How to use UI Element "AbstractApplet" to embedd java applet in WDA

    Hello,
    I want to embedd a java applet in a WebDynpro ABAP application and I've found the following statement on SAP online help:
    The Active Control Framework (ACF) enables the development of applets or ActiveX-based controls that can be embedded in Web Dynpro ABAP.
    Link:[AbstractApplet|http://help.sap.com/saphelp_nwpi71/helpdata/en/47/b915bc878a2d67e10000000a42189c/frameset.htm]
    Is there any further help, how to use this (abstract) UI Element to integrate a given java applet?
    Kind Regards,
    Guido

    Hi,
    As per the link you gave,
    In the View layout, You can use the UI elements like - AcfExecute and AcfUpDownload. For upload and download the things.
    Try to use these UI elements and get the reference of the Abrstact APplet class and use the methods inside it.
    Regards,
    Lekha.

  • How to use debugproxy for debugging on AS-Java?

    Dear Sirs,
    I'd like to debug java program on AS-Java without occupying AS-Java instance.
    I expect debugproxy can help it.
    I could enable it on SAP Management Console, but I don't know how to use it with NWDS.
    Could I get instraction of using debugproxy with NWDS?
    In addition, I'm afraid that my idea is feasible and debugging always occupy AS-Java instance. It means I have to have another instance specified for debugging.
    Please advise me.
    Best regards,
    Shingo Suzuki

    Hi Shingo,
    Not always
    Check [this|SAP NW CE 7.1: Start Debug Session... vs. Enable Debugging; thread.
    HTH!
    \-- Vladimir

  • How to use Contribute to edit html or java script

    I have a client who use Contribute to edit web pages but they
    are unable to edit the html or javascript. I have a javascript
    photogallery they want to update but they can't. Is there away
    around this? I tried a flash gallery but they still can't update
    the xml file. Am I missing something here?

    You can give your users the rights to Edit page source in
    external application (both for xml as javascript):
    1. Main menu>Edit>Administer websites, pick site
    2. Users and Roles, pick role, click Edit role settings
    3. go to Editing and check 'Allow users to edit web page
    source in external application'
    When your users opens (using the Choose btn next to
    addressbar) a .js or .xml file in Contribute (tested in CS3) just
    click the 'Edit btn' and Contribute will open the file in the
    editor you selected.
    How to select the editors:
    1. Main menu>Edit>Preferences
    2. go to File Editors.
    If this does not work in your version maybe you can use Main
    menu>File>Actions>Edit page source in external
    application.

  • Accessing Java Resource in a Java class

    How does one go about accessing a java resource object from a java class loaded into the database?
    I created a.properties file and loaded it using loadjava.
    Next I wrote a class in which I try to load the resource:
    import java.io.*;
    import java.util.*;
    public class C {
    public static void load() throws Exception {
    Properties p = new Properties();
    p.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("a.properties"));
    I then published method load as procedure p.
    When I execute p, I get the following error:
    SQL> exec p
    java.lang.NullPointerException
    at C.load(C.java:5)
    BEGIN p; END;
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NullPointerException
    ORA-06512: at "QSI.P", line 0
    ORA-06512: at line 1
    Thanks
    Suresh

    Never mind. I resolved this using a ResourceBundle, thanks to another posting on this forum. I must say, the oracle documentation for this feature is scant and erroneous.
    How does one go about accessing a java resource object from a java class loaded into the database?
    I created a.properties file and loaded it using loadjava.
    Next I wrote a class in which I try to load the resource:
    import java.io.*;
    import java.util.*;
    public class C {
    public static void load() throws Exception {
    Properties p = new Properties();
    p.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("a.properties"));
    I then published method load as procedure p.
    When I execute p, I get the following error:
    SQL> exec p
    java.lang.NullPointerException
    at C.load(C.java:5)
    BEGIN p; END;
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NullPointerException
    ORA-06512: at "QSI.P", line 0
    ORA-06512: at line 1
    Thanks
    Suresh

  • How to use tomcat JNDI  resource in eclipse

    hi all, In my project i am using JSF,Tomcat,eclipse... i am planing to implement annotaions as part of my application
    I want to use Jndi resource as part of my project by using java annotaions
    for this i configured my server.xml in tomcat as
    <Context docBase="ALWREPORTSNEW" path="/ALWREPORTSNEW"
    reloadable="true"
    source="org.eclipse.jst.jee.server:ALWREPORTSNEW" >
    <Resource auth="Container"
    driverClassName="com.mysql.jdbc.Driver" maxActive="10000"
    maxIdle="3000" maxWait="10000" name="jdbc/enrollmentschema"
    password="adminadmin" removeAbandoned="true"
    removeAbandonedTimeout="300" type="javax.sql.DataSource"
    url="jdbc:mysql://localhost:3306/enrollment_schema_old"
    username="root" />
    </Context>And i configured web.xml as
    <resource-ref>
    <description>Enrollment Schema Connection pooling</description>
    <res-ref-name>jdbc/enrollmentschema</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>And some where in my project i am using annotaion as follows. i am getting NULL when trying access that annotaion .
    @Resource(name = "jdbc/mobileEnrollProd") DataSource mobileds;
    @Resource(name = "jdbc/enrollmentschema")
    private DataSource enrollds;
    public String UploadBankWise() {
    System.out.println("--------- ds "+enrollds);// *i am getting NULL*
    }but same code working with Glassfish and net benas..
    can any body hint me where i did mistake
    thanks in advance

    Go to Window-Preferences-Java-Debug-Step Filtering. When the dialog opens, press F1 for help. Good luck!

  • How to used a JCR Data Control in Java class?

    Hi,
    I created a JCR Data Control to my UCM to obtain a treeTable with the datas. But it's impossible to create a treeTable like i want to.
    So I know how to create a treeModel to obtain the treeTable I want.
    Is there a way to used the getItems method of the dataControl in a Java Class?
    I tried this :
    BindingContext bc = (BindingContext)JSFUtils.resolveExpression("#{data}");
    DCDataControl dc = bc.findDataControl("UcmDC");
    But dc is null.
    There are some xml files (UcmDC.xml or getItems_return.xml). Is it a way to resolve my problem. And if so, how do I use?
    Best regards,
    Thomas

    please refer metalink id(305710.1)

  • How to use URL class to execute a java class/app  on a remote machine?

    I am a beginner in Java networking and have a question about URL programming.
    How do I pass parameters to a java class/application over the web and then cause it to execute ? I then want to get the result back from the clas/app. The class/app resides on a remote machine and the protocol used is "http" protocol. OR all this is not possible through the URL and related classes ?

    How do I pass parameters to a java class/application over the web and then cause it to execute ? Using the HTTP protocl you can either perform a GET where the parameters are in the URL or a POST where the data is sent to the server with the request.
    The server must be setup as a web server to execute code based ojn a HTTP request. Using a web server with a JSP which contains the code to execute is the simplest way to do this.
    I then want to get the result back from the clas/app. The output of the JSP becomes in the data returned by the HTTP request.
    I would suggest looking for example on google.
    http://www.google.co.uk/search?q=java+http+request+tutorial
    Another option is to use RMI. The integration is tighter but it does not use the HTTP protocol.

  • How to use a self compiling compiler in Java

    I'm creating a user-customizable calculator - a calculator where the user can create his/her own buttons while the calculator runs.
    What I need to know is how I can get the calculator to compile an instruction - i.e. what a new button does, and add it to itself.
    For example, and user would create a button that calculates (UK) V.A.T by writing y = (x*0.175)
    This instruction would then be compiled while the calculator was running and be added to the calculator.
    Thanks,
    Aled.

    You need to think about how the whole system is going to work - you need to know everything that the button will require, and then think about how to provide this information to the button.
    So, by the sounds of you need say a single button to press when you want to add a new button to the calculator. Associated with this have text fields that take the function for the calculator. I would specify that the function uses variables e.g. x and y as in function = x * y. Then your program could parse the input string describing the function, by recognising "*" to mean * in the Java code syntax and "/" to mean /. Then treat everything else as variables. Since you can filter out the other variables i.e. not the operators, you can then say associate an array to contain the values of these. Then when the user uses the button and specifies the input parameters and presses the button, you can update this array, and perform the calculation based upon these values.
    Hope this helps.
    My advice really is just to think about everything that a button that creates new function buttons is going to need.
    PS. Remember to repaint the GUI once update its Container. Swing does this automatically, but I always specify it explicitly anyway to be safe. You can use either repaint(), validate(), or revalidate().
    Goodluck mate!

  • How to use schedule task for execute my java file

    I have five java file.
    I want every 20 minutes all of them executed.
    how to write the program for scheduling that execution.

    > I have five java file.
    I want every 20 minutes all of them executed.
    how to write the program for scheduling that
    execution.
    I recommend using an external application (e.g., Task Scheduler, cron, etc.) to handle this kind of scheduling.
    ~

Maybe you are looking for

  • Creating variables in AS3 that Captivate can read.

    I have a Flash project written in AS3 and I am colaborating with someone that is writing a Captivate training program.  The Flash program is a little game and I need to store a couple integers readable by Captivate.   I would like to just create the

  • Non-admin user cannot access Essbase server level variables

    Version 11.1.1.3 Essbase Substitution variables are created at server level. Users are getting error in FR report that uses the Subsitution Variable -- Essbase Error(1051085): You do not have sufficient access to get this substitution variable. Also,

  • IWeb '08 movie playback problem on Windows

    Hello, I used iWeb '08 to create a Photo Page that I've uploaded to my .Mac space. The Photo Page is mostly photos, but also contains two movie clips. One is a 1 MB .AVI file. The other one is an 8.7 MB .m4v file. When I load up the photo page in Fir

  • Urgent Help Plz... Help Me..from Muhammad

    Haiy guys can any i tell me that whcih Video format is better QCIF Video or VGA Video plz.. reply I m waiting. From Muhammad. Muhammad

  • J2EE, JSTL and JSF questions

    I am trying to learn J2EE/JSTL/JSF and have quite a few general questions. Any help on any of these is appreciated. 1) Is there a way, just by using J2EE/Java to "manipulate" an XML file. Not just parse and read it's data but actually add nodes to th