Please send  me a java program

PLEASE SEND ME A Program to create buttons,text box,background images,etc

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import javax.imageio.*;
public class AWTDemo
    public static void main(String[] args)
        ComponentPanels componentPanels = new ComponentPanels();
        Frame f = new Frame();
        f.addWindowListener(new WindowAdapter()
            public void windowClosing(WindowEvent e)
                System.exit(0);
        f.add(componentPanels.getButtonPanel(), "North");
        f.add(new BackgroundPanel());
        f.add(componentPanels.getTextPanel(), "South");
        f.setSize(400,300);
        f.setLocation(200,200);
        f.setVisible(true);
class BackgroundPanel extends Panel
    Image image;
    public BackgroundPanel()
        loadImage();
    public void paint(Graphics g)
        super.paint(g);
        int width = getWidth();
        int height = getHeight();
        int imageWidth = image.getWidth(this);
        int imageHeight = image.getHeight(this);
        int x = (width - imageWidth)/2;
        int y = (height - imageHeight)/2;
        g.drawImage(image, x, y, this);
    public void update(Graphics g)
        paint(g);
    private void loadImage()
        String fileName = "images/mntgoat.jpg";
        try
            URL url = getClass().getResource(fileName);
            image = ImageIO.read(url);
        catch(MalformedURLException mue)
            System.out.println(mue.getMessage());
        catch(IOException ioe)
            System.out.println(ioe.getMessage());
class ComponentPanels
    public Panel getButtonPanel()
        final Button
            button1 = new Button("Button 1"),
            button2 = new Button("Button 2"),
            button3 = new Button("Button 3");
        ActionListener l = new ActionListener()
            public void actionPerformed(ActionEvent e)
                Button button = (Button)e.getSource();
                String s = "";
                if(button == button1)
                    s = "button 1";
                if(button == button2)
                    s = "button 2";
                if(button == button3)
                    s = "button 3";
                System.out.println(s + " pressed");
        button1.addActionListener(l);
        button2.addActionListener(l);
        button3.addActionListener(l);
        Panel panel = new Panel();
        panel.add(button1);
        panel.add(button2);
        panel.add(button3);
        return panel;
    public Panel getTextPanel()
        TextField tf = new TextField(12);
        Panel panel = new Panel();
        panel.add(tf);
        return panel;
}

Similar Messages

  • How to send sms through java program?

    hi,
    i am trying to send sms through java program.i am usining ubuntu 6.04.i am using modem MC35i.i use the jSMSEnjine.jar and rxtxcomm.jar.
    these are the following program.
    import org.jsmsengine.*;
    import java.util.*;
    class SendMessage
         public static void main(String[] args)
              int status;
              // Create jSMSEngine service.
         CService srv = new CService("Com2",9600);
              //CService srv = new CService("COM2",9600);
              System.out.println();
              System.out.println("SendMessage(): sample application.");
              System.out.println(" Using " + srv._name + " " + srv._version);
              System.out.println();
              try
                   //     Initialize service.     
                   srv.initialize();
                   Thread thread =Thread.currentThread();
                   thread.sleep(1000);
                   System.out.println(srv);
                   //     Set the cache directory.
                   srv.setCacheDir(".\\");
                   //     Set the phonebook.
                   //     srv.setPhoneBook("../misc/phonebook.xml");
                   //     Connect to GSM device.
                   status = srv.connect();
                   //     Did we connect ok?
                   int st=CService.ERR_OK;
                   System.out.println(st);
                   System.out.println(status);
                   if (status == CService.ERR_OK)
                        //     Set the operation mode to PDU - default is ASCII.
                        srv.setOperationMode(CService.MODE_PDU);
                        // Set the SMSC number (set to default).
                        srv.setSmscNumber("");
                        //     Print out GSM device info...
                        System.out.println("Mobile Device Information: ");
                        System.out.println("     Manufacturer : " + srv.getDeviceInfo().getManufacturer());
                        System.out.println("     Model : " + srv.getDeviceInfo().getModel());
                        System.out.println("     Serial No : " + srv.getDeviceInfo().getSerialNo());
                        System.out.println("     IMSI : " + srv.getDeviceInfo().getImsi());
                        System.out.println("     S/W Version : " + srv.getDeviceInfo().getSwVersion());
                        System.out.println("     Battery Level : " + srv.getDeviceInfo().getBatteryLevel() + "%");
                        System.out.println("     Signal Level : " + srv.getDeviceInfo().getSignalLevel() + "%");
                        //     Create a COutgoingMessage object and dispatch it.
                        //     *** Please update the phone number with one of your choice ***
    // String smsLengthTest="Hi"+"\nTesting is going on.Test for sending unlimited number of charecter.So you will get N number of SMS.Initially I trancate the whole string by 70 charecter.Later I will put it upto 90 charecter.Some chararecter should kept for header portion.I don't know the total number.It is just test.If you got the sms u should appreciate me...This is Ripon...I have written sms program";
    String smsLengthTest="Hi\n"+"This is Govindo";
    int mao=smsLengthTest.length();
    System.out.println("Length of sms :"+mao);
    String smsNo="9433314095";
    smsNo="+91"+smsNo;
    if(mao<70)
    COutgoingMessage msg = new COutgoingMessage(smsNo,smsLengthTest);
    //     Character set is 7bit by default - lets make it UNICODE :)
    //     We can do this, because we are in PDU mode (look at line 63). When in ASCII mode,
    //          this does not make ANY difference...
    msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_UNICODE);
    if (srv.sendMessage(msg) == CService.ERR_OK) System.out.println("Message Sent!");
    else System.out.println("Message Failed!");
    else
    // COutgoingMessage msg = new COutgoingMessage(smsNo,smsLengthTest);
    // LinkedList messageList;
    // messageList = new LinkedList();
    // messageList.add(msg);
    // LinkedList maooo=new LinkedList();
    // maooo=srv.splitLargeMessages(messageList);
    int sizelength=0;
    int counter=0;
    sizelength=smsLengthTest.length();
    System.out.println("SMS length :"+sizelength);
    int smsCntr=sizelength/70;
    System.out.println("smsCntr :"+smsCntr);
    counter=smsCntr+1;
    int j=70;
    int k=0;
    try
    for(int i=0;i<smsCntr;i++)
    String test="";
    test=test+i;
    test=smsLengthTest.substring(k,j);
    System.out.println(test);
    System.out.println(test.length());
    COutgoingMessage msg = new COutgoingMessage(smsNo, test);
    System.out.println("hi this is suman" + smsNo);
    //     Character set is 7bit by default - lets make it UNICODE :)
    //     We can do this, because we are in PDU mode (look at line 63). When in ASCII mode,
    //          this does not make ANY difference...
    msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_UNICODE);
    if (srv.sendMessage(msg) == CService.ERR_OK) System.out.println("Message Sent!");
    else System.out.println("Message Failed!");
    k=k+70;
    j=j+70;
    catch(Exception e)
    System.out.println("Error...1");
    e.printStackTrace();
    e.getMessage();
    String lastPortion=smsLengthTest.substring(k);
    System.out.println(lastPortion);
    COutgoingMessage msg = new COutgoingMessage(smsNo, lastPortion);
    //     Character set is 7bit by default - lets make it UNICODE :)
    //     We can do this, because we are in PDU mode (look at line 63). When in ASCII mode,
    //          this does not make ANY difference...
    msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_UNICODE);
    if (srv.sendMessage(msg) == CService.ERR_OK) System.out.println("Message Sent!");
    else System.out.println("Message Failed!");
                        // Disconnect from GSM device.
                        srv.disconnect();
                   else System.out.println("Connection to mobile failed, error: " + status);
              catch (Exception e)
                   e.printStackTrace();
              System.exit(0);
    the error is:
    SendMessage(): sample application.
    Using jSMSEngine API 1.2.6 (B1)
    org.jsmsengine.CService@addbf1
    0
    -101
    Connection to mobile failed, error: -101
    please help me,its very urgent.

    come back in about 5 years, we may have time for you by then.
    In the meantime, how about contacting the people who wrote that library and asking them nicely for help (rather than trying to order people to drop whatever they're doing and jump through hoops to accommodate your every wish as you're doing here)?

  • How to send SMS from Java program?

    Hello,
    I want to know, how can I send SMS from Java program.I dont have any idea about SMS gateways. Can any one give me Sample code for sending the SMSs from Java Program.
    Thanks,
    -BR

    hi,
    refer javamail concepts
    http://www.google.co.in/search?q=javamail+simple+example&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

  • How to send fax using java programming

    i need to send files in my hard disk through fax using java programming.
    i have found on the internet that it is possible to be implemented by using java.comm API and JTAPI. however, i don't know how...does anyone can tell me the details? also, as i know it will be a big project to send fax using such API. is that any other simple way to implement the fax function in java? thx a lot!

    To cse.mahbub:
    Are you aware that you replied to a 5 1/2 year old question?
    Please don't do that. Reply only to current questions.

  • Send signal from java program to Excel document

    Hi
    I have a Java-program that once a day brings information from a website on the internet. When this has been done, I want to send a signal to an Excel document to run a vba-macro. The "signal" can e.g. be to put a value in a certain cell in the Excel document.
    Any ideas on how to do this?

    Thanks gtRpr I didnt actually know what webservices are so I looked them up, below is one of definintions i got, and this is not what I want. The class that i write will be only used by me and only to extract data from one website.
    >
    Web services allow organizations to communicate data without intimate knowledge of each other's IT systems behind the firewall.
    secruity is not a problem, so there should be no need to encypt. Here is the kind of steps that I have put together so far, please could you comment on them...
    1. find out what the textfields are called on the website that need //do this by hand once
    2. parse the website username and password
    3. traverse to correct web page
    4. return page info in xml format //sorry im new to this side of programming, is it easy to convert html - xml
    5. need to strip out all unessary xml comments to reveal me with my specific data
    Thanks
    Edited by: calypso on Aug 8, 2008 2:15 AM

  • Sending mail from java program

    I want to send mail from my java program.
    does anyone have the sample code?

    http://forum.java.sun.com/thread.jsp?forum=31&thread=266116

  • Send mail through Java program. ERROR javax.mail.MessagingException: [EOF]

    Hi,
    i've a java Mail program which will send the mail thro smtp server.
    when i try to execute this program im getting the error javax.mail.MessagingException: [EOF]
    i've attached both code & error.
    while running the program need to give the arguments
    ex : java SendMail smtpserver frommailid tomailid subject body
    please provide me the solution.
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    public class SendMail {
         public static void main(String[] args) {
              try
         String smtpServer=args[0];
         String to=args[1];
         String from=args[2];
         String subject=args[3];
         String body=args[4];
         send(smtpServer, to, from, subject, body);
         catch (Exception ex)
         System.out.println("Usage: java SendMail"
         +" smtpServer toAddress fromAddress subjectText bodyText");
         System.exit(0);
         public static void send(String smtpServer, String to, String from
                   , String subject, String body)
                   try
                   Properties props = System.getProperties();
                   props.put("mail.smtp.host", smtpServer);
                   Session session = Session.getDefaultInstance(props, null);
                   Message msg = new MimeMessage(session);
                   msg.setFrom(new InternetAddress(from));
                   msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
                   msg.setSubject(subject);
                   msg.setText(body);
                   msg.setSentDate(new Date());
                   System.out.println("test 1--");
                   Transport.send(msg);
                   System.out.println("test 2--");
                   System.out.println("Message sent OK.");
                   catch (Exception ex)
                   ex.printStackTrace();
    thanks for the help in advance.
    regs
    lal.

    I ran into a similar error today. I fixed it by setting up SMTP authentication because my ISP's help pages said that they would allow only SMTP authentication.
    Here is what I did:
    Transport transport =
    mailConnection.getTransport("smtp");
    transport.connect(
    "hostname", "email", "password");
    Transport.send(msg);
    I also passed the following property while creating the session:
    props.put("mail.smtp.auth", "true");
    finally turning on debug helped:
    session.setDebug(true);
    session.setDebugOut(null);
    Hope this helps

  • How to send mail through java program in solaris server

    hi
    i am writing java code to send the mail using my company SMTP
    ,the program is working fine when i run and deploy in windows environment
    but at the same time when i deploy the war to sun solaris server ,it is not working
    and throwing the Error saying
    java.lang.Exception: Invalid Addresses; nested exception is:      javax.mail.SendFailedException: 553 sorry, that domain isn't allowed to be relayed thru this MTA without authentication #5.7.1     at jsp.SendMail._jspService(_SendMail.java:137)
    i am using the Authentication also using user id and password of same domain and it is able to authenticate
    in windows but not in Solaris
    where i am making mistake plz
    guide.
    Saurabh

    thanks Alan
    but i think there is some other problem because same code is
    working when i am using in windows as well as i am using authentication method
    also but it is not working when running in Solaris Environment
    here is the code i am using to send the mail
    props.setProperty("mail.transport.protocol", "smtp");
    props.setProperty("mail.host", "smtp.mycompany.com");//smtp protocol for IIBF
    props.put("mail.smtp.starttls.enable","true");//setting start TLS to be true
    props.put("mail.smtp.auth", "true");// authentication is false
    props.put("mail.smtp.port", port);//setting the port number it can be either 25 or 587
    props.put("mail.smtp.username", "noreply");
    props.put("mail.smtp.password","noreply");
    props.put("mail.debug", "true");
    Authenticator auth = new SMTPAuthenticator();
    Session session1 = Session.getDefaultInstance(props);
    java.util.Properties sessionProperties = new java.util.Properties();
    sessionProperties.put("mail.smtp.auth", "true");
    message.setFrom(new javax.mail.internet.InternetAddress(From ,"name"));
    message.addRecipient(javax.mail.Message.RecipientType.TO, new javax.mail.internet.InternetAddress(To));
    message.setText(TextCo);
    message.setSubject(subject);
    message.setContent(boyd, "text/plain");
    message.reply(true);
    Transport trans = session1.getTransport("smtp");
    trans.connect(SMTP_HOST_NAME, SMTP_AUTH_USER, SMTP_AUTH_PWD);
    boolean ddd = trans.isConnected();
    message.saveChanges();
    trans.sendMessage(message, message.getAllRecipients());
    above code is working properly in windows but not in Solaris
    plz guide what next to do
    thankx in advance
    saurabh

  • Please send HR ALV format programs

    hai all,
    if any body develop the hr report in alv format pls send the code that wiil be usefull to me.
    thanks,
    lakshma

    Have a look at http://www.sapdevelopment.co.uk/programs/custom/zp_postcode.htm
    *: Report:  ZP_POSTCODE                                                :
    *: Author:  www.SAPDev.co.uk                                           :
    *: Date  :  2004                                                       :
    *: Description: Displays report of employees by postcode area,         :
    *:              includes current travelling allowances (i.e. parking   :
    *:              permit or transport card etc..)                        :
    *: Use:         Help encourage the use of car sharing and public       :
    *:              transport where appropriate.                           :
    REPORT  zp_postcode.
    type-pools: slis.                                      "ALV Declarations
    NODES: pernr.
    INFOTYPES: 0000, 0001, 0002, 0006, 0008, 0014, 0105, 0121.
    SELECTION-SCREEN BEGIN OF BLOCK pcode WITH FRAME TITLE text-s01.
    SELECT-OPTIONS: so_pcode FOR p0006-pstlz.
    SELECTION-SCREEN END OF BLOCK pcode.
    TYPES: BEGIN OF t_output,
      pernr       TYPE p0001-pernr,   "personnel name
      anredtxt    TYPE t522t-atext,   "title (based on p0002-anred)
      fname       TYPE p0002-vorna,   "first name
      lname       TYPE p0002-nachn,   "last name
      orgtx       TYPE t527x-orgtx,   "dept
      fte         TYPE p0008-bsgrd,   "fte
      parking(20) TYPE c,
      payslip     TYPE t526-sachn,        "payslip address
      telno       TYPE p0105-usrid_long,  "tel number(p0105-usrty = 0020)
      email       TYPE p0105-usrid_long,  "email (p0105-usrty = MAIL)
      postcode    type p0006-pstlz,
    END OF t_output.
    DATA: it_output TYPE STANDARD TABLE OF t_output INITIAL SIZE 0,
          wa_output TYPE t_output.
    *ALV data declarations
    data: fieldcatalog   type slis_t_fieldcat_alv with header line,
          gd_tab_group   type slis_t_sp_group_alv,
          gd_layout      type slis_layout_alv,
          gd_repid       like sy-repid,
          gt_events      type slis_t_event,
          gd_prntparams  type slis_print_alv,
          gd_count(6)    type n,
          gd_outtext(70) type c,
          gd_lines       type i.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    clear: gd_count.
    GET pernr.
    Infotype 0121 is used to store multiple contracts for personnel.
    Field p0121-hpern contains the personnel number for the main contract.
      PROVIDE * from p0121 between pn-begda and pn-endda.
      Check if main contract
        if p0121-pernr ne p0121-hpern.
          reject.
        endif.
      ENDPROVIDE.
      add 1 to gd_count.
      concatenate 'Processing personnel data'(m10) gd_count into gd_outtext
                separated by ' '.
    Display indicator for employee count
      perform progress_indicator using gd_outtext.
    Retrieve datd from infotypes
      rp_provide_from_last p0000 space pn-begda pn-endda.
      rp_provide_from_last p0001 space pn-begda pn-endda.
      rp_provide_from_last p0002 space pn-begda pn-endda.
      rp_provide_from_last p0006 space pn-begda pn-endda.
      rp_provide_from_last p0008 space pn-begda pn-endda.
      rp_provide_from_last p0014 space pn-begda pn-endda.
    Check post code
      CHECK p0006-pstlz IN so_pcode.  "cp
    Post code
      wa_output-postcode = p0006-pstlz.
    Personnel number
      wa_output-pernr = pernr-pernr.
    Personnel title
      SELECT SINGLE atext
        FROM t522t
        INTO wa_output-anredtxt
       WHERE sprsl EQ sy-langu AND
             anred EQ p0002-anred.
    First name
      wa_output-fname = p0002-vorna.
    Last name
      wa_output-lname = p0002-nachn.
    Organizational Unit text (dept)
      SELECT SINGLE orgtx
        FROM t527x
        INTO wa_output-orgtx
       WHERE sprsl EQ sy-langu AND
             orgeh EQ p0001-orgeh AND
             endda GE sy-datum.
    FTE
      wa_output-fte = p0008-bsgrd.
    Parking / travel deducted?
      CASE p0014-lgart.
        WHEN '7180' OR '7181' OR '7182'.
          wa_output-parking = text-002.
        WHEN '7183'.
          wa_output-parking = text-001.
        WHEN '7171' OR '7172' or '7173' or '7174' or
             '7175' or '7176' or '7177' or '7178'.
          wa_output-parking = text-003.
      ENDCASE.
    Payslip Address
      SELECT SINGLE sachn
        FROM t526
        INTO wa_output-payslip
       WHERE werks EQ p0001-werks AND
             sachx EQ p0001-sacha.
      PROVIDE * from p0105 between pn-begda and pn-endda.
      Telephone numbers
        if p0105-usrty = '0020'.
           wa_output-telno = p0105-usrid_long.
        endif.
      Email address
        if p0105-usrty = 'MAIL'.
           wa_output-email = p0105-usrid_long.
        endif.
      ENDPROVIDE.
      append wa_output to it_output.
      clear: wa_output.
    *END-OF-SELECTION.
    END-OF-SELECTION.
    describe table it_output lines gd_lines.
    if gd_lines gt 0.
      perform build_fieldcatalog.
      perform build_layout.
      perform display_alv_report.
    else.
      message i003(zp) with 'No records found'.
    endif.
    *&      Form  PROGRESS_INDICATOR
          Displays progress indicator on SAP screen
    form progress_indicator using p_text.
      call function 'SAPGUI_PROGRESS_INDICATOR'
          exporting
            PERCENTAGE = 0
               text       = p_text.
    endform.                    " PROGRESS_INDICATOR
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
      fieldcatalog-fieldname   = 'PERNR'.
      fieldcatalog-seltext_m   = 'Personnel No.'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
    fieldcatalog-emphasize   = 'X'.
    fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'ANREDTXT'.
      fieldcatalog-seltext_m   = 'Title'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'FNAME'.
      fieldcatalog-seltext_m   = 'First Name'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'LNAME'.
      fieldcatalog-seltext_m   = 'Last Name'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'ORGTX'.
      fieldcatalog-seltext_m   = 'Department'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'FTE'.
      fieldcatalog-seltext_m   = 'FTE'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PARKING'.
      fieldcatalog-seltext_m   = 'Parking/Metrocard'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PAYSLIP'.
      fieldcatalog-seltext_m   = 'Payslip Add.'.
      fieldcatalog-col_pos     = 7.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'TELNO'.
      fieldcatalog-seltext_m   = 'Telephone'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EMAIL'.
      fieldcatalog-seltext_m   = 'E-mail'.
      fieldcatalog-col_pos     = 9.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'POSTCODE'.
      fieldcatalog-seltext_m   = 'Post code'.
      fieldcatalog-col_pos     = 10.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
      gd_layout-zebra             = 'X'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_output
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " DISPLAY_ALV_REPORT
    Best Regards,
    Vibha
    *Plz mark useful answers

  • Java program to perform binary addition,subtraction and modulus.

    i am a newbie to java and require ur urgent help plzzzz.
    i wanna perform binary addition,subtraction and modulus operation between two numbers of 512 bit without using java functions i.e by simple logics of control statements.i need to convert two 512 bit numbers passed as string into binary form, and then perform addition,subtraction and modulus operations on these two binary numbers and finally dipaly the result in decimal format.
    i think we may use full adder binary logic in this!!!
    please send me the java coding for these three operations as urgent as possible on my email.
    i would be highly obliged.
    thanks.
    sheetal.

    i have managed to make this code myself but i wanna learn the basics...so plz help me guyz...
    this is the code:
    package bytearrayopeations;
    import java.math.BigInteger;
    * @author sheetalb
    public class binaryadding {
    public static void main(String[] args) {
    BigInteger a = new BigInteger("123456");
    BigInteger b = new BigInteger("5121");
    String bb1 = a.toString(2);
    String bb2 = b.toString(2);
    String ss1 = null;
    String ss2 = null;
    String result = "";
    String carry="0";
    System.out.println("first value=" +bb1);
    System.out.println("second value=" +bb2);
    int k=bb1.length();
    int h=bb2.length();
    System.out.println("length 1="+ k);
    System.out.println("length 2=" +h);
    int p=h-k;
    //System.out.println("difference=" +p);
    int q=k-h;
    //System.out.println("difference 2=" +q);
    if(h==k)
    else if(h>k)
    for(int i=0;i<p;i++)
    bb1="0"+bb1;
    System.out.println("new value of first=" +bb1);   
    else if(h<k)
    for(int i=0;i<q;i++)
    bb2="0"+bb2;
    System.out.println("new value of second=" +bb2);
    StringBuffer sb1=new StringBuffer(bb1);
         StringBuffer sb2=new StringBuffer(bb2);
    bb1=sb1.reverse().toString();
         bb2=sb2.reverse().toString();
    //System.out.println("rev. buffer1=" +bb1);
    //System.out.println("rev. buffer2=" +bb2);
    for(int i=0;i<bb1.length();i++)
    ss1=bb1.substring(i,i+1);
    ss2=bb2.substring(i,i+1);
    System.out.println("value1=" + ss1 + " " + "value2=" + ss2);
    if (ss1.equals("0") && ss2.equals("0"))
    if (carry.equals("0"))
    result+="0";
    else
    result+="1";
    else if (ss1.equals("1") && ss2.equals("1"))
    if (carry.equals("0"))
    result+="0";
              carry="1";
              else
                   result+="1";
                   carry="1";
    else if (ss1.equals("0") && ss2.equals("1"))
    if (carry.equals("0"))
         result+="1";
                   carry="0";
                        else
                        result+="0";
    carry="1";
    else if (ss1.equals("1") && ss2.equals("0"))
    if (carry.equals("0"))
    result+="1";
    carry="0";
                   else
    result+="0";
    carry="1";
    System.out.println("sum=" result " " + "carry" + carry);
    result+=carry;
    StringBuffer sb3=new StringBuffer(result);
    result=sb3.reverse().toString();
    System.out.println("result is " +result); 
    System.out.println("Binary = "+ result + ", Decimal = "+Integer.parseInt(result,2));
    plz reply nw...

  • Can any one please send me sample programs using java mapping..

    <b>Can any one please send me sample programs using java mapping with input and output?</b>
    please let me know how to get started with java mapping?
    Prerequisites for java mapping ?
    What are the jars need to be deployed for SAX,DOM.  And how to do it in NWDS?
    Use of Execute() and setparameter() ... StreamTransformation?
    Some sample program using java mapping with simple logic(input and output)?

    Hi,
    Did you go thro these blogs?
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    Nice blogs to start Java Mapping.
    Go thro this one too.
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    Regards,
    P.Venkat
    Message was edited by:
            Venkataramanan

  • I did write a simple java program but it is not working please help me.....

    This is the program I wrote LineRect just to draw a line a rectangle etc...... Y it is not working How can i used the same program to run without using applet that is by using awt and swing.........Pls Help me.............
    import java.awt.*;
    import java.io.*;
    public class LineRect
    {public void paint(Graphics g)
         {g.drawLine(10,10, 50,50);
         g.drawRect(10, 60, 40,30);
         g.fillRect(60,10,30,80);
         g.drawRoundRect(10,100,80,50,10,10);
         g.fillRoundRect(20,110,60,30,5,5);
         g.drawLine(100,10,230,140);
         g.drawLine(100,140,230,10);
    <APPLET
    CODE =LineRect.class
    WIDTH=250
    HEIGHT=200>
    </APPLET>

    There are many significant errors here for instance you are using a class file as if it were an applet yet you do not subclass applet. Your code has no init method (if it is to be an applet). Your best bet is to go through the tutorials one step at a time. One thing to consider is to subclass a JPanel and draw on the jpanel overriding the paintComponent method. This can then be added to a JFrame or a JApplet's contentPane and would allow the same graphics in both. But again, please study the tutorials on all of this, otherwise you will be doing hit-or-miss programming, and that is no way to learn.
    Much luck!
    Addendum: Also, if you are just beginning in Java programming, I suggest you start with the basics and not with Swing / AWT / graphics programming. Otherwise you will just end up bruised and disappointed. You have to learn to walk before you can run.
    Edited by: Encephalopathic on Dec 26, 2007 5:09 AM

  • How to send a file from a java program to a servlet and get a response

    Hi,
    How can I call a servlet from a standalone java program and send a file to a servlet using POST method and in return gets the status back from the servlet. Any help is appreciated any small sample will help.
    Thanks.

    Hi,
    I am trying the following sample I got from net and am getting the following error. Any help what I am doing wrongs:
    06/12/24 02:15:58 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
    06/12/24 02:15:58      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:294)
    06/12/24 02:15:58      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
    06/12/24 02:15:58      at mypackage9.Servlet1.doPost(Servlet1.java:38)
    06/12/24 02:15:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    06/12/24 02:15:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    06/12/24 02:15:58      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    06/12/24 02:15:58      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    06/12/24 02:15:58      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
    06/12/24 02:15:58      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
    06/12/24 02:15:58      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
    06/12/24 02:15:58      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
    06/12/24 02:15:58      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
    06/12/24 02:15:58      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    06/12/24 02:15:58      at java.lang.Thread.run(Thread.java:534)Here is the sample client code:
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.methods.PostMethod;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    public class PostAFile {
        private static String url =
             "http://192.168.0.17:8988/Vulcan_Materials-ServletPost2-context-root/servlet/Servlet1";
        public static void main(String[] args) throws IOException {
            HttpClient client = new HttpClient();
            PostMethod postMethod = new PostMethod(url);
            client.setConnectionTimeout(8000);
            File f = new File("C:\\load.txt");
            System.out.println("File Length = " + f.length());
            postMethod.setRequestBody(new FileInputStream(f));
            int statusCode1 = client.executeMethod(postMethod);
            System.out.println("statusLine>>>" + postMethod.getStatusLine());
            postMethod.releaseConnection();
    }Here is the sample servlet code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    import org.apache.commons.fileupload.DiskFileUpload;
    import org.apache.commons.fileupload.FileItem;
    import java.util.List;
    import java.util.Iterator;
    import java.io.File;
    public class Servlet1 extends HttpServlet
      private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
      public void init(ServletConfig config) throws ServletException
        super.init(config);
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
        try
          response.setContentType(CONTENT_TYPE);
          PrintWriter out = response.getWriter();
          java.util.Enumeration e= request.getHeaderNames();
            while (e.hasMoreElements()) {
              String headerName=(String)e.nextElement();
              System.out.println(headerName +" = "+request.getHeader(headerName));
           //System.out.println("Content Type ="+request.getContentType());
            DiskFileUpload fu = new DiskFileUpload();
            // If file size exceeds, a FileUploadException will be thrown
            fu.setSizeMax(1000000);
            List fileItems = fu.parseRequest(request);
            Iterator itr = fileItems.iterator();
    System.out.println("***************************");
            while(itr.hasNext()) {
              FileItem fi = (FileItem)itr.next();
              //Check if not form field so as to only handle the file inputs
              //else condition handles the submit button input
              if(!fi.isFormField())
                System.out.println("\nNAME: "+fi.getName());
                System.out.println("SIZE: "+fi.getSize());
                //System.out.println(fi.getOutputStream().toString());
                File fNew= new File("C:\\", fi.getName());
                System.out.println(fNew.getAbsolutePath());
                fi.write(fNew);
              else
                System.out.println("Field ="+fi.getFieldName());
            out.println("SUCCESS123456: ");
          out.close();
        catch(Exception e)
          e.printStackTrace();
    }Any help on what is wrong.
    Thanks

  • How to have an Oracle procedure send and receive value from a java program.

    The below procedure is place inside a package. This procedure "get_extract_ready_headers " is selecting columns store_number, terminal_number, tran_number, tran_date, cust_id from the source REX_HEAD_EXTRACT table. This information is selected into a ref cursor. The data has cust_id field which is encrypted. How do I modify the procedure get_extract_ready_headers and accomplish 2 things?
    1. Make this procedure to read the "cust_id" value from the source table and send the value to a Java program "getheaderinfo" (this java program decrypts the cust_id field).
    2. When we get the unencrypted value back from the Java program, make the procedure accept this decrypted value and use it to update CUST_ID value in the target table TRAN_HEAD table. I am using Oracle 11.2.0.2, and TOAD 10.5.1.3.
    -- Procedural code
    PROCEDURE get_extract_ready_headers (p_records OUT SYS_REFCURSOR)
    IS
    BEGIN
       OPEN p_records FOR
       SELECT store_number, terminal_number, tran_number, tran_date, cust_id FROM REX_HEAD_EXTRACT;
    END;--Table Structure for source table REX_HEAD_EXTRACT
    CREATE TABLE REX_HEAD_EXTRACT
      REX_SEQ_NBR         NUMBER(20),
      REVISION_NUMBER         NUMBER,
      DAY                     NUMBER(3),
      RESA_TRAN_SEQ_NO        NUMBER(20),
      BUSINESS_DATE           DATE,
      TRAN_SEQ_NBR            NUMBER(12),
      ORG_NUMBER              NUMBER,
      STORE_NUMBER            NUMBER,
      TRAN_DATE               DATE,
      TERMINAL_NUMBER         NUMBER,
      TRAN_NUMBER             NUMBER,
      TRAN_TIME               DATE,
      BATCH_NUMBER            VARCHAR2(8 BYTE),
      BATCH_TYPE              VARCHAR2(4 BYTE),
      TRAN_TYPE               VARCHAR2(4 BYTE),
      SUB_TRAN_TYPE           VARCHAR2(4 BYTE),
      CLERK_CODE              VARCHAR2(15 BYTE),
      TRAN_TAXABLE_AMOUNT     NUMBER(12,2),
      TRAN_TAX_TOTAL          NUMBER(12,2),
      TRAN_GROSS_TOTAL        NUMBER(12,2),
      COUP_TOTAL              NUMBER(9,2),
      MKD_TOTAL               NUMBER(9,2),
      EMPLOYEE_NUMBER         VARCHAR2(15 BYTE),
      EMPLOYEE_NAME           VARCHAR2(40 BYTE),
      TRAN_ALTTAXABLE_AMOUNT  NUMBER(12,2),
      TRAN_ALTTAX_TOTAL       NUMBER(12,2),
      SALE_AMOUNT             NUMBER(9,2),
      RETURN_AMOUNT           NUMBER(9,2),
      RETURNED_AMOUNT         NUMBER(9,2),
      NETCASH                 NUMBER(12,2),
      TENDER_CODE             VARCHAR2(4 BYTE),
      MULT_RCPT               VARCHAR2(1 BYTE),
      SPLIT_TENDER            VARCHAR2(1 BYTE),
      RTN_WITH_PURCHASE       VARCHAR2(1 BYTE),
      RTN_WITH_RCPT           VARCHAR2(1 BYTE),
      REASON_CODE             VARCHAR2(4 BYTE),
      PASSWORD                VARCHAR2(10 BYTE),
      RINGTIME                DATE,
      CUST_NUMBER             VARCHAR2(12 BYTE),
      CUST_ID                 VARCHAR2(50 BYTE),
      ZIP_CODE                NUMBER,
      POSTAL_CODE             VARCHAR2(9 BYTE),
      PV_TIME_LAPSE           NUMBER,
      ORIG_STORE_NBR          NUMBER,
      ORIG_TRAN_DATE          DATE,
      ORIG_TRAN_TYPE          VARCHAR2(4 BYTE),
      ORIG_TERM_NBR           NUMBER,
      ORIG_TRAN_NBR           NUMBER,
      ORIG_SALE_AMT           NUMBER(12,2),
      ORIG_TENDER_CODE        VARCHAR2(4 BYTE),
      ORIG_CLERK_CODE         VARCHAR2(15 BYTE),
      PREV_TRAN_TYPE          VARCHAR2(4 BYTE),
      PREV_SUB_TRAN_TYPE      VARCHAR2(4 BYTE),
      GIFT_REGISTRY_ID        VARCHAR2(25 BYTE),
      NO_OF_ITEMS             NUMBER,
      TAX_EXEMPT_ID           VARCHAR2(18 BYTE),
      TRAN_RINGTIME           NUMBER,
      AUDITED                 VARCHAR2(1 BYTE),
      BATCH_VERSION           NUMBER(9,2),
      BATCH_SOURCE            VARCHAR2(5 BYTE),
      CREATE_DATE             DATE,
      CREATE_ID               VARCHAR2(32 BYTE),
      CREATE_PROC             VARCHAR2(32 BYTE),
      MOD_DATE                DATE,
      MOD_ID                  VARCHAR2(32 BYTE),
      MOD_PROC                VARCHAR2(32 BYTE),
      TERMINAL_GROUP          NUMBER,
      USER_DEF_1              NUMBER,
      USER_DEF_2              NUMBER,
      USER_DEF_3              NUMBER,
      USER_DEF_4              NUMBER(12,2),
      USER_DEF_5              NUMBER(12,2),
      USER_DEF_6              NUMBER(12,2),
      USER_DEF_7              VARCHAR2(50 BYTE),
      USER_DEF_8              VARCHAR2(50 BYTE),
      USER_DEF_9              VARCHAR2(50 BYTE),
      MANAGER_NUMBER          VARCHAR2(15 BYTE),
      MANAGER_REASON_CODE     VARCHAR2(10 BYTE),
      MANAGER_SWIPED          VARCHAR2(1 BYTE),
      PHONE_NO                NUMBER(11),
      KCPOS_KTH_USER_101      NUMBER,
      KCPOS_KTH_USER_102      NUMBER,
      KCPOS_KTH_USER_103      NUMBER,
      KCPOS_KTH_USER_104      NUMBER,
      KCPOS_KTH_USER_105      NUMBER,
      KCPOS_KTH_USER_106      NUMBER,
      KCPOS_KTH_USER_107      NUMBER,
      KCPOS_KTH_USER_108      NUMBER,
      KCPOS_KTH_USER_109      NUMBER,
      KCPOS_KTH_USER_110      NUMBER,
      KCPOS_KTH_USER_201      NUMBER(12,2),
      KCPOS_KTH_USER_202      NUMBER(12,2),
      KCPOS_KTH_USER_203      NUMBER(12,2),
      KCPOS_KTH_USER_204      NUMBER(12,2),
      KCPOS_KTH_USER_205      NUMBER(12,2),
      KCPOS_KTH_USER_206      NUMBER(12,2),
      KCPOS_KTH_USER_207      NUMBER(12,2),
      KCPOS_KTH_USER_208      NUMBER(12,2),
      KCPOS_KTH_USER_209      NUMBER(12,2),
      KCPOS_KTH_USER_210      NUMBER(12,2),
      KCPOS_KTH_USER_301      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_302      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_303      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_304      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_305      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_306      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_307      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_308      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_309      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_310      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_401      DATE,
      KCPOS_KTH_USER_402      DATE,
      KCPOS_KTH_USER_403      DATE,
      DISC_TOTAL              NUMBER(9,2)
    CREATE INDEX REX_HEAD_EXTRACT_NDX ON REX_HEAD_EXTRACT
    (REX_SEQ_NBR, REVISION_NUMBER, STORE_NUMBER, TRAN_DATE, TERMINAL_NUMBER, TRAN_NUMBER)-- Create table DDL for target table TRAN_HEAD
    CREATE TABLE NAVISTOR.KCPOS_TRAN_HEADER_BASE
      TRAN_SEQ_NBR            NUMBER(12),
      ORG_NUMBER              NUMBER,
      STORE_NUMBER            NUMBER,
      TRAN_DATE               DATE,
      TERMINAL_NUMBER         NUMBER,
      TRAN_NUMBER             NUMBER,
      TRAN_TIME               DATE,
      BATCH_NUMBER            VARCHAR2(8 BYTE),
      BATCH_TYPE              VARCHAR2(4 BYTE),
      TRAN_TYPE               VARCHAR2(4 BYTE),
      SUB_TRAN_TYPE           VARCHAR2(4 BYTE),
      CLERK_CODE              VARCHAR2(15 BYTE)     NOT NULL,
      TRAN_TAXABLE_AMOUNT     NUMBER(12,2),
      TRAN_TAX_TOTAL          NUMBER(12,2),
      TRAN_GROSS_TOTAL        NUMBER(12,2),
      COUP_TOTAL              NUMBER(9,2),
      MKD_TOTAL               NUMBER(9,2),
      EMPLOYEE_NUMBER         VARCHAR2(15 BYTE),
      EMPLOYEE_NAME           VARCHAR2(40 BYTE),
      TRAN_ALTTAXABLE_AMOUNT  NUMBER(12,2),
      TRAN_ALTTAX_TOTAL       NUMBER(12,2),
      SALE_AMOUNT             NUMBER(9,2),
      RETURN_AMOUNT           NUMBER(9,2),
      RETURNED_AMOUNT         NUMBER(9,2),
      NETCASH                 NUMBER(12,2),
      TENDER_CODE             VARCHAR2(4 BYTE),
      MULT_RCPT               VARCHAR2(1 BYTE),
      SPLIT_TENDER            VARCHAR2(1 BYTE),
      RTN_WITH_PURCHASE       VARCHAR2(1 BYTE),
      RTN_WITH_RCPT           VARCHAR2(1 BYTE),
      REASON_CODE             VARCHAR2(4 BYTE),
      PASSWORD                VARCHAR2(10 BYTE),
      RINGTIME                DATE,
      CUST_NUMBER             VARCHAR2(12 BYTE),
      CUST_ID                 VARCHAR2(50 BYTE) ENCRYPT USING 'AES256' NO SALT,
      ZIP_CODE                NUMBER,
      POSTAL_CODE             VARCHAR2(9 BYTE),
      PV_TIME_LAPSE           NUMBER,
      ORIG_STORE_NBR          NUMBER,
      ORIG_TRAN_DATE          DATE,
      ORIG_TRAN_TYPE          VARCHAR2(4 BYTE),
      ORIG_TERM_NBR           NUMBER,
      ORIG_TRAN_NBR           NUMBER,
      ORIG_SALE_AMT           NUMBER(12,2),
      ORIG_TENDER_CODE        VARCHAR2(4 BYTE),
      ORIG_CLERK_CODE         VARCHAR2(15 BYTE),
      PREV_TRAN_TYPE          VARCHAR2(4 BYTE),
      PREV_SUB_TRAN_TYPE      VARCHAR2(4 BYTE),
      GIFT_REGISTRY_ID        VARCHAR2(25 BYTE),
      NO_OF_ITEMS             NUMBER,
      TAX_EXEMPT_ID           VARCHAR2(18 BYTE),
      TRAN_RINGTIME           NUMBER,
      AUDITED                 VARCHAR2(1 BYTE),
      BATCH_VERSION           NUMBER(9,2),
      BATCH_SOURCE            VARCHAR2(5 BYTE),
      CREATE_DATE             DATE,
      CREATE_ID               VARCHAR2(32 BYTE),
      CREATE_PROC             VARCHAR2(32 BYTE),
      MOD_DATE                DATE,
      MOD_ID                  VARCHAR2(32 BYTE),
      MOD_PROC                VARCHAR2(32 BYTE),
      TERMINAL_GROUP          NUMBER,
      USER_DEF_1              NUMBER,
      USER_DEF_2              NUMBER,
      USER_DEF_3              NUMBER,
      USER_DEF_4              NUMBER(12,2),
      USER_DEF_5              NUMBER(12,2),
      USER_DEF_6              NUMBER(12,2),
      USER_DEF_7              VARCHAR2(50 BYTE),
      USER_DEF_8              VARCHAR2(50 BYTE),
      USER_DEF_9              VARCHAR2(50 BYTE),
      MANAGER_NUMBER          VARCHAR2(15 BYTE),
      MANAGER_REASON_CODE     VARCHAR2(10 BYTE),
      MANAGER_SWIPED          VARCHAR2(1 BYTE),
      PHONE_NO                NUMBER(11),
      KCPOS_KTH_USER_101      NUMBER,
      KCPOS_KTH_USER_102      NUMBER,
      KCPOS_KTH_USER_103      NUMBER,
      KCPOS_KTH_USER_104      NUMBER,
      KCPOS_KTH_USER_105      NUMBER,
      KCPOS_KTH_USER_106      NUMBER,
      KCPOS_KTH_USER_107      NUMBER,
      KCPOS_KTH_USER_108      NUMBER,
      KCPOS_KTH_USER_109      NUMBER,
      KCPOS_KTH_USER_110      NUMBER,
      KCPOS_KTH_USER_201      NUMBER(12,2),
      KCPOS_KTH_USER_202      NUMBER(12,2),
      KCPOS_KTH_USER_203      NUMBER(12,2),
      KCPOS_KTH_USER_204      NUMBER(12,2),
      KCPOS_KTH_USER_205      NUMBER(12,2),
      KCPOS_KTH_USER_206      NUMBER(12,2),
      KCPOS_KTH_USER_207      NUMBER(12,2),
      KCPOS_KTH_USER_208      NUMBER(12,2),
      KCPOS_KTH_USER_209      NUMBER(12,2),
      KCPOS_KTH_USER_210      NUMBER(12,2),
      KCPOS_KTH_USER_301      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_302      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_303      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_304      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_305      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_306      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_307      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_308      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_309      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_310      VARCHAR2(50 BYTE),
      KCPOS_KTH_USER_401      DATE,
      KCPOS_KTH_USER_402      DATE,
      KCPOS_KTH_USER_403      DATE,
      DISC_TOTAL              NUMBER(9,2),
      RTA_RTN_AUTCOD          VARCHAR2(4 BYTE),
      RTA_RTN_COMMID          NUMBER,
      RTA_RTN_EVNTID          NUMBER,
      RTA_RTN_QTY             NUMBER,
      RTA_RTN_RCPT_SCAN       VARCHAR2(1 BYTE),
      RTA_RTN_REFUND_AMT      NUMBER(9,2),
      RTA_RTN_TYPE_CODE       VARCHAR2(4 BYTE),
      RTA_RTN_WITH_RCPT       VARCHAR2(1 BYTE),
      RTA_RTN_COUNT           INTEGER,
      SDEDVAL1                VARCHAR2(50 BYTE)
    )--sample data
    REX_SEQ_NBR,REVISION_NUMBER,DAY,RESA_TRAN_SEQ_NO,BUSINESS_DATE,TRAN_SEQ_NBR,ORG_NUMBER,STORE_NUMBER,TRAN_DATE,TERMINAL_NUMBER,
    TRAN_NUMBER,TRAN_TIME
    478,1,11,12024005,6/11/2012,,1,692,6/11/2012,155,5,6/11/2012 12:57:17 PM,
    479,1,11,12024006,6/11/2012,,1,692,6/11/2012,155,6,6/11/2012 2:01:51 PM,
    480,1,11,12024007,6/11/2012,,1,692,6/11/2012,155,7,6/11/2012 2:47:10 PM

    Assuming that SomeJavePgm is a Java stored function (not a Java program running outside the database) and that it takes as a parameter whatever data type CUST_ID is in TABLE_A (hopefully RAW but potentially VARCHAR2) and returns a string, you would call it just as you would a PL/SQL stored function
    INSERT INTO table_b( cust_id, <<other columns>> )
      SELECT SomeJavaPgm( a.cust_id ), <<other columns>>
        FROM table_a aIf SomeJavePgm is not a Java stored procedure, calling it from PL/SQL becomes much more complicated. You would need whatever machine hosts this program to expose an appropriate API (for example, a web service interface) that you could invoke via UTL_HTTP). You'd need to tell us what that API was, however.
    Justin

  • My first java programming - Need some help please!!!

    I have to create a simple java program which i am not good at i am ok in C but my java is quite bad. The program need to define a class called Student and with a string called StudentNAme, a integer StudentID(key), An array of 8 integers called Marks that holds the students marks for 8 modules. It also says Include appropriate accessors, mutators and constructor(s) as well as a method to update the student�s marks. Anybody please help me in this question. I prefer an simple example of this program so I can learn faster, I dont even know how to declare a class.. So sorry but please help me out and thanks in advance

    I would also suggest you try using an IDE like
    eclipse (free)
    www.eclipse.org
    This will help you get a working program much faster.But please do also tell them that if they have troubles using it, they're supposed to read the IDE manual instead of posting here.

Maybe you are looking for

  • No sound in windows 7 bootcamp macbook pro 15" retina

    Hi and good day, I recently purchased a mbp 15" retina and decided to install windows 7 professional via bootcamp. Upon completion, i realised that there was no sound from the speakers or the headphone jack. I updated the bootcamp drivers to the late

  • Java.lang.NullPointerException when using readTemplate with WLST offline

    I imported WLST offline as a module in to jython script and tried wlstOffline.readTemplate('../wls.jar') It gives me a java.lang.NullPointerException. Here is the entire stack trace Traceback (innermost last):   File "testOffline.py", line 3, in ?  

  • Bad system config info

    Hello, OS WIN 8.1 HP Pavillion I got this message Bad system config info on a blue screen. I can't boot up the OS, even tried safe mode and nothing works. Tried Refresh and nothing. I need to access my documents and using HP recovery manager with fla

  • JSP tags; html formatting problem

    Hi, I've implemented a jsp custom action which supports several enclosed tags in like this: <%@ taglib ..... prefix="myprefix" %> <myprefix:myTag ... > <myprefix:myNestedTag ... /> <myprefix:myNestedTag ... /> </myprefix:myTag> I have three classes t

  • Discoverer 3I and Cyrilic character set

    I have a discoverer 3I EUL set up and I'm trying to pull data out that is stored in the database using the cyrilic character set. All I get, however, when I view the data is ? substituted for the cyrilic character. Is discoverer able to handle cyrili