How to connect C program in applet

this is my applet code and i get two values.
what i need is, i want to add that two values in C program and it retruns the value....
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
public class add extends JApplet
JPanel main;
JLabel l1, l2;
JTextField t1, t2;
TextArea result;
JButton submit;
public void init()
main = new JPanel();
l1 = new JLabel ("Number one:");
l2 = new JLabel ("Number two:");
t1 = new JTextField (20);
t2 = new JTextField (20);
submit = new JButton("Submit");
result = new TextArea(7,80);
getContentPane().add(main);
main.add(l1);
main.add(t1);
main.add(l2);
main.add(t2);
main.add(submit);
main.add(result);
Enter next = new Enter();
submit.addActionListener(next);
class Enter implements ActionListener
     public void actionPerformed(ActionEvent ent)
          Object obj = ent.getSource();
          if(obj == submit)
               String val1 = t1.getText();
               String val2 = t2.getText();
               if(val1.length()==0 || val2.length()==0)
                    getAppletContext().showStatus("Enter the two values.");
                    return;
               } else {
                    getAppletContext().showStatus("Wait...");
                    return;
pls help me.
regards
prasad

JNI is the only way to call native code from java code, but I don't think the applet can get permission to make JNI calls.
Otherwise applet will become the most dangerous downloadable programs.

Similar Messages

  • How to connect my access database using applet?

    hi all,
    i need to connect my access database in my applet program which should work like an atm machine..I dont know how to connect it. Im new to applet same thing in JDBC application. Please help i terribly need it, our deadline in our case study is fast approaching and i still dont know how to do it. I tried the tutorial but i received some sql exception error. thanks!

    Try this link
    http://java.sun.com/docs/books/tutorial/jdbc/basics/

  • How does a standalone program running in JDeveloper connects to Oracle

    Hi,
    Can anybody please answer me how does a standalone program running in JDeveloper10G is getting connected to Oracle ? Normally it should go and check the host address and DB service name in TNSNames.ora file and go ahead. With JDeveloper10 ever after changing the TNSNames.ora file name to some other name the program running in Jdeveloper is getting connected to database. Seems weird ? I was actually doing some testing with that. Anybody please tell me how does JDeveloper handles such situations...
    Regards
    CTR
    Edited by: user8325217 on Oct 9, 2008 2:54 PM

    Yes, it depends on the type of JDBC driver you are using. Oracle has two JDBC drivers for Java clients. The oci driver requires an installation of Oracle Client on each machine running the Java app, and has the potential to use the tnsnames.ora entries. The thin driver is pure Java, does not require Oracle Client, and therefore is not aware of tnsnames.ora files.
    You want to look in your code for the part that's establishing a connection to the db, and look at the URL, which will tell you the type of driver being used, for example "jdbc:oracle:thin" or "jdbc:oracle:ociX".
    You might want to check out the following FAQ on JDBC:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm
    Brian
    Product Manager, JDeveloper

  • How to connect iseries green screen from java program

    how to connect iseries green screen from java program to get the data in the DB files ,here the DB is DB2/400

    Just some Friday fun. Use the telnet program that comes with Windows and supports VT escape sequences.
    import java.io.*;
    import java.net.*;
    public class AutoTelnet {
         private static Socket s;
         public static void main(String[] args) throws Exception {
              Thread t = new Thread() {
                   @Override public void run() {
                        try {
                             s = new ServerSocket(5555).accept();
                        } catch (IOException ex) {
                             ex.printStackTrace();
              t.start();
              Process p = new ProcessBuilder("cmd", "/C", "start", "telnet", "127.0.0.1", "5555").redirectErrorStream(true).start();
              t.join();
              PrintStream ps = new PrintStream(s.getOutputStream());
              ps.println("Screen will be cleared in 5 seconds");
              ps.println("5");
              Thread.sleep(1000);
              ps.println("4");
              Thread.sleep(1000);
              ps.println("3");
              Thread.sleep(1000);
              ps.println("2");
              Thread.sleep(1000);
              ps.println("1");
              Thread.sleep(1000);
              ps.println("\u001b[2J");
              Thread.sleep(5000);
    }

  • How to connect Oracle 9i / 10g to a Java ( JDK 1.4 / J++) Program?

    Hello,
    I have written a java program in JDK 1.4 ( Which I have compiled in J++).
    I am dont know how to connect oracle ( 9i / 10g) as Backend to my java program.
    Please send the code / instructions to connect my backend.
    my program includes oracle tables..
    Please help me..
    thank you
    Jayanth

    Use JDBC, but who the hell uses J++ anymore?

  • How to connect to DB2 from ABAP program

    Hi,
    In my ABAP program I need to retrieve 3 fields from one table of DB2 database. I have tried creating an RFC connection in SM59 and then using native SQL in abap code but could not succeed.
    I have also maintained an entry in DBCON table but am unable to connect through program.
    Pls suggest.
    Thanx in advance.

    Preeti-
    DBCON may not work for you because your target is DB2. You SAP system should have the suitable driver files for connecting to DB2 and I don't think currently this is supported.
    However, there are other ways of doing it. One ofcourse is to use a middleware tool, which I guess you don't have in your landscape.
    If investing on a middleware tool is out of scope, here are other options
    1) If you are a microsoft shop, use .NET connector (freely downlaodable from SAP service market place). You can develop a .NET component which will use .NET connector for connecting to SAP and OBDC to connect to your AS400 system. The OBDC drivers can be obtained from IBM.
    2) If you are a java shop, you can develop a java code which can run on your AS400 system or a separte server (windows,unix..).
    This java code will use JRFC/JCO (again downloadable for free from SAP service market place) to connect to SAP while it will use Client access ODBC drivers or JT400 drivers (google JT400) to connect to your DB2 database.
    Though developing this is not a great deal, could be bit challenging if done for the first time. Let me know which way you wanna go and I can guide with more information/code samples.
    KK

  • How to call java program by HTML page

    Hi guys,
    I'm new java programer and want to build an HTML page to access to ORACLE database on NT server by JDBC, Can anyone give me a sample?
    I already know how to access database by JDBC, but I don't know how to call java program by HTML page.
    If you have small sample,pls send to me. [email protected], thanks in advance
    Jian

    This code goes with the tutorial from this web page
    http://java.sun.com/docs/books/tutorial/jdbc/basics/applet.html
    good luck.
    * This is a demonstration JDBC applet.
    * It displays some simple standard output from the Coffee database.
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.util.Vector;
    import java.sql.*;
    public class OutputApplet extends Applet implements Runnable {
    private Thread worker;
    private Vector queryResults;
    private String message = "Initializing";
    public synchronized void start() {
         // Every time "start" is called we create a worker thread to
         // re-evaluate the database query.
         if (worker == null) {     
         message = "Connecting to database";
    worker = new Thread(this);
         worker.start();
    * The "run" method is called from the worker thread. Notice that
    * because this method is doing potentially slow databases accesses
    * we avoid making it a synchronized method.
    public void run() {
         String url = "jdbc:mySubprotocol:myDataSource";
         String query = "select COF_NAME, PRICE from COFFEES";
         try {
         Class.forName("myDriver.ClassName");
         } catch(Exception ex) {
         setError("Can't find Database driver class: " + ex);
         return;
         try {
         Vector results = new Vector();
         Connection con = DriverManager.getConnection(url,
                                  "myLogin", "myPassword");
         Statement stmt = con.createStatement();
         ResultSet rs = stmt.executeQuery(query);
         while (rs.next()) {
              String s = rs.getString("COF_NAME");
              float f = rs.getFloat("PRICE");
              String text = s + " " + f;
              results.addElement(text);
         stmt.close();
         con.close();
         setResults(results);
         } catch(SQLException ex) {
         setError("SQLException: " + ex);
    * The "paint" method is called by AWT when it wants us to
    * display our current state on the screen.
    public synchronized void paint(Graphics g) {
         // If there are no results available, display the current message.
         if (queryResults == null) {
         g.drawString(message, 5, 50);
         return;
         // Display the results.
         g.drawString("Prices of coffee per pound: ", 5, 10);
         int y = 30;
         java.util.Enumeration enum = queryResults.elements();
         while (enum.hasMoreElements()) {
         String text = (String)enum.nextElement();
         g.drawString(text, 5, y);
         y = y + 15;
    * This private method is used to record an error message for
    * later display.
    private synchronized void setError(String mess) {
         queryResults = null;     
         message = mess;     
         worker = null;
         // And ask AWT to repaint this applet.
         repaint();
    * This private method is used to record the results of a query, for
    * later display.
    private synchronized void setResults(Vector results) {
         queryResults = results;
         worker = null;
         // And ask AWT to repaint this applet.
         repaint();

  • How to connect our outbound function module to the message type

    how to connect our outbound function module to the message type any transcation code exits to assign the message type with the function module .
    Thank in advance .
    A. Thiru

    Hi Thiru,
    Standard Transaction Codes, have their own Function Modules for generating Outbound/Indbound Idocs. Where these Function Modules will be configured to a particular Process Codes.
    For E.g for PO's
    Process code : ME10 - IDOC_OUTPUT_ORDERS - for creation
    In case if its a Z Function Module, It depends on the case how you use IDOC types. either directly through Z Program or through Inbound/Outbound Process  codes with respective Function modules.
    Regards,
    Anbalagan

  • How to Connect Airport Express to Existing Wireless Network (Client Mode)

    I am posting this for everyone tearing their hair out trying to connect the Airport Express to your own existing home wireless network. After spending 2 hours last night installing this on my father-in-law's home network, I hope to be able to save someone else the agony we went through.
    So here's the situation:
    Say you already have your own home network set up, and all you want is to be able to use AirTunes to play music off iTunes into your speaker system. And, you don't need the printer sharing capability nor creation of another wireless network (2 of the features of Airport Express). Then this solution is for you - read on.
    Unfortunately, Apple's user manual is very unclear how to connect Airport Express to your own network. When you look at the picture diagram they provide, they show Airport Express picking up its signal from another Apple-oriented base. This can make you think you need to buy another piece of hardware to make it work. DON'T If you read through the manual, the Support section here, etc., you will hear lots of talk about "Client Mode" - and that this is the only way to get it to work. Nice - but no one really tells you how to set up the Airport in client mode.
    Do yourself a favor, toss that user manual aside and run these steps.
    (Note: These directions assume your DSL/Cable Modem is hooked up to a wireless router or acts as its own wireless router)
    1. Get a cat5 Ethernet cable (anything but an orange cable - that's a crossover cable) like you would use to connect your PC to your router to pick up the Internet.
    2. Connect the Ethernet cable to the router on one end, and to the Airport Express unit on the other end.
    3. Plug in your Airport Express unit to the wall (this will not necessarily become its permanent location - you will be able to move it later). The light will glow solid Amber for about 30-45 seconds while it starts up, then blink Amber. At this point, the unit is ready to operate.
    4. Install the CD to the PC where your iTunes music is stored. This should be painless. Once you open the program, it should detect the Airport unit.
    5. At this point, the on-screen wizard will present you with your options, and walk you through the setup. This is much like the user manual describes - and you should be good to go form here forward.
    Some pointers:
    - When asked if you want to create a new network, join an existing network, or connect via Ethernet, choose the middle option for joining an existing network. You will need to know the name of your network, the password to connect to the network (if present), and the type of encryption used on the network (e.g. WEP, WPA, etc.). Side note, WPA is recommended, as it is a higher level of security than WEP. You will be able to configure the Airport Express unit to automatically login to your network.
    - I would recommend, when creating a password for the Airport Express unit, use the same password as your network, to avoid confusion.
    6. The very last step will ask you to save the settings to the Airport Express. Here's the kicker - when you save the settings, you are TRICKING the Airport Express into no longer acting as a network broadcaster, but instead being a "slave" to your own network. What do I mean? You will lose the connection from your PC to the Airport Express - an error message will pop up telling you the unit can no longer be found. While you might think you did something wrong, you actually were successful!
    7. Unplug your Airport Express, and disconnect the Ethernet cable from your router and the Airport unit. This will no longer be needed.
    8. Go to your desired location where you want to plug in your Airport Express unit. Before plugging it in, connect your Audio cable from the Airport Express to your audio receiver. Once that is connected, then plug in the Airport Express unit. The light will glow solid Amber for 30-45 seconds while it loads, and then will blink Amber for a brief period of time before turning solid GREEN. When this happens, you have successfully connected the Airport Express to your home network!
    9. Go back to your PC with iTunes. Open the Airport software - you should now have a listing for your Airport Express unit in the upper left. Click on this, and the wizard will guide you through connecting - you will need the password you created for the unit. You only need to go through this wizard once, and when finished, the software will tell you that can now use iTunes with your Airport unit.
    10. Open iTunes. On the lower right, you will see a dropdown for Speakers, and it should be defaulted to My Computer. Click on that drop-down, and you will see the name of your Airport unit. Click on that name, and now your music will broadcast to the Airport unit!
    11. Play a song in iTunes. Go to your audio receiver, and connect it to the channel for your external connection to the Airport Express unit. You should hear your music from iTunes. CONGRATULATIONS! =)
    I hope these instructions were helpful - I am happy to answer any questions, so feel free to contact me, *******************@*****.**.
    <Edited by Moderator>

    Thanks for the detailed directions. You are absolutely correct in stating that people should toss the user manual; it's pretty worthless. I have had a problem setting up my new Airport Express as I have described in an earlier post - http://discussions.apple.com/thread.jspa?threadID=1839873&tstart=45
    One quick question - does using your setup process set the AE up as part of a distributed network where the AE is acting as a wireless router where it is extending the range of your network? Or, is it simply a wireless connection to your stereo for iTunes? I am interested in having both, since my AE will be at the other end of the house from the main wireless router.
    Thanks

  • How to load a java card applet into a java card

    Dear All,
    I am a novice to java card technology..
    I have done some search on how to load a java card applet into a smart card but haven't found a satisfactory answer. I have read about installer.jar and scriptgen tool but I want to load the applet from a java program and not from command line. It would be of great help if somebody can help me out.
    If somebody can share a sample program which load a javacard applet(.CAP file) into a smart card, I will be very thankful.
    I am able to find some client applications which help us send APDU commands and recieve response APDU's to interact with an applet loaded on to the smart card but not application which actually load the applet.
    I have heard of OCF and GP.. some say that OCF technology is outdated and no longer in use.. can somebosy throw some light on this too..
    cheers,
    ganesh

    hi siavash,
    thanks for the quick response.. i checked out GPShell as suggested, it looked like a tool by which one can load an applet on to card and send some sample apdu commands... but I want to load the applet from the code.
    My application should look something like this.. it will be a swing applicaton where I have a drop down with a list of readers, I select the one desired and then click on "LOAD" after inserting a blank java card, at this point my applet which is stored in my DB should get loaded on to the java card. The next step should be to personalize it where I enter the values for the static variables of my applet and click "PERSONALIZE", at this point all these values should be embedded into APDU commands and sent to the java card for processing.
    For achieving this I am yet to find a comprehensive sample or documentation on the net.
    Please help...
    regards,
    ganesh

  • How to connect to oracle ebs from an external software

    Hi!
    I want to develop an integration for oracle EBS. Therefor I'm looking for ways how to connect to the EBS and for a repository of functions which can be called from an external program. I'm not quite sure if this is the right place to ask but I could not find anything yet so I'm trying here.
    Are there any standard connectors for the EBS provided by Oracle?
    Thanks,
    Konrad

    Oracle Applications Architecture is a framework for multi-tiered, distributed computing that supports Oracle Applications products. In this model, various servers are distributed among multiple levels/tiers as follows:
    - The Desktop Tier --> Web browser with Jinitiator or Sun JRE
    - The Application Tier --> Web, Forms, Reports, Admin, and Concurrent servers
    - The Database Tier --> Oracle Enterprise Edition Database
    The Application tier is the layer which is responsible for:
    - Hosting the various servers that process the business logic
    - Managing communication between the desktop tier and the database tier
    So, in order to connect to the database, you can either access the application tier, or connect directly to the database. I do not think it is possible to communicate with the application services from some other application. Therefore, you would need to connect to the database directly which can be achieved as explained in my previous reply. There is no such API which can be used to open/close a database connection. Oracle E-Business Suite is just a database with number of schemas and objects which are tightly integrated.
    More details about Oracle E-Business Architecture can be found in:
    Oracle Applications Concepts
    http://download-uk.oracle.com/docs/cd/B25516_14/current/acrobat/11iconcepts.pdf

  • How to connect MS Access or other d/b tools to SAP R/3

    Hi SAP Experts,
    I got a requirement i.e by using MS Access or other database tools to take the SAP table dumps and analyze gaps or errors in the system data using business guided .
      I don't know how to connect MS Access to SAP R/3 and how to connect other database tools to SAP R/3.
    pls any body can explain me on this topic or inform me where i can get the corresponding documents.
    This is urgent for me.
    I appreciate you're help.

    Hi,
    For some databases (for example MSSQL, Oracle,...) you can use transaction DBCO (table DBCON) to create connection to external database. Then you can use native SQL in ABAP programs (EXEC SQL command).
    Krzys

  • 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

  • How to connect Trigger USB-6009 on a flowmeter

    I have a flowmeter with the data:
    sensing principle: hall-effect, non contacting
    output square wave: NPN o.c.
    Voltage supply: 4,5-24 VDC
    output current: 13mA max
    more you can find in the attachement and i use the USB-6009.
    How i have to connect the flowmeter to the trigger (PFI0)?
    Thanks in advance for any help!
    E.Stein
    Attachments:
    flowmeter.pdf ‏17 KB

    Thanks for
    Info!
    I work with
    LabVIEW 8.6 and the configure and programming 
    of
    falling-edge
    events is not the problem.
    The Problem
    is the connection. How to connect the flowmeter to the
    USB-6009? Because the 6009 have no gate and out.

  • How to connect external trigger PCI-1433

    Hi all:
    I met the same problem as this old post: https://forums.ni.com/t5/Machine-Vision/How-to-connect-external-trigger-PCIe-1433/m-p/1677560/highli...
    however the post did not give solution.
    I am having an issue getting the external trigger( from PCI 6259) to work with a cameralink camera, a PCIe-1433 card . The PCI 6259 is connected to BNC 2111, the output trigger signal from CTR0 is connected to the SMB connector on the 1433 card and is providing pulse train at TTL voltages (0-5V).  Using the MAX SOFTWARE and under the Acquisition tab I have CC1 set to external 0, however the camera is not receiving this external trigger. The camera is Basler 4096-140km.
    I measured the ouiput signal from CTL0, the sigal seems good.
    I tried RTSI trigger before, failded. I thought SMB should be more straight forward, seems I was wrong.
    Looking forward to reply!
    Attachments:
    camera configuration.jpg ‏168 KB
    External Camera Trigger(SMB).vi ‏57 KB

    Bobjojo,
    You will actually need to affect the properties of both the camera and the frame grabber to take advantage of this triggering mode. I found a document that contains a good run down of the process to acquire in this mode (linked below). As far as the programming for the acquisition is concerned, the frames will be built at the driver level for the specified frame height. This means that the IMAQ driver will composite the line scans for you, and any simple acquisition (the document shows using the Vision Acquisition Express VI) will be able to pull the image into LabVIEW.
    www.ni.com/white-paper/13786/en/pdf
    Karl G.
    Applications Engineer
    ni.com/support

Maybe you are looking for

  • Error in Updating Business Place in MM documents

    Dear Experts, I have 2 Questions.. Q1. I have created a subsitution rule for updating business place and section code in documents and it's working fine for FI documents but business place and section is not updating in MM documents (MIRO) . Please s

  • Error message when opening itunes...please help

    I recently tried to purchase music on the itunes store, and was told to do so I had to upgrade to itunes 7, which i had put off for quite a while...however, now that I have done so, I get a error that comes up each time I open iTunes, telling me a ne

  • BPM Workspace 10gR3 Portlet integration in WebCenter 11g

    Hi guys, I want to integrate my BPM processes within WebCenters portal. What i want to do is to present my bpm workspace inside portlets that will live in Webcenter. My question is, if there is an out-of-the-box solution in webcenter for doing this o

  • Macbook Air 13

    Hi. I am wanting to connect 2 external monitors to my Macbook Air 13. Any suggestions?

  • HUM vs. sales return

    Dear All, We did the following process: 1. SO for materialA 2. Delivery refering to the SO 3. Pack materialA with mat_pack, based on configuration delivery item was created for mat_pack automatically. 4. Picking (WM picking for materialA and normal p