Need procedure to exchane the code java to abap

hi,
i have one issue.that is i have one web link that is developed by using the java programming.now i want to see that link in abap E.C.C 6.0.i need the procedure for that how to do and all.
thanks.

Hi,
Please find the link
http://searchsap.techtarget.com/searchSAP/downloads/chapter-june.pdf
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e07753b9-fa0c-2a10-64a8-c6754c45396e
It might help you.
Thanks & Regards
Edited by: Ranjit Kumar on Oct 23, 2008 9:32 AM

Similar Messages

  • I need help I scratched the code off my itunes card

    I need help I scratched the code off my itunes card

    Click here and ask the iTunes Store staff for assistance. Supply them with as much of the code as you can.
    (102006)

  • I have tried another exercise, but again I will need help, here's the code

    hi,
    I have another problem. here's the question pluss the code.
    public interface Patient{
    public void doVisit(float hour);
    public boolean hospitalize();
    1. I will need to write a class name OrdinaryPatient which extends Patient.
    the class will include value int that his name age and another value that will be boolean
    of disease.
    I have to do two constructors. one that don't get values and give them default and the other one
    that does get values.
    another method name docVisit which get a visit to the doctor time visit and will print a message.
    the method hospitalize will hospitalize the patient (and if he will have disease he will get true).
    and for age I have to write methods of get and set.
    2. I will need to write a class of Hipochondriac that extends from OrdinaryPatient.
    I have to do two constructors. one that don't get values and make default and the other one that do get values.
    I will need to ade int by the name of numberOfHospitalize.
    I will need to move the method hospitalize that it will be possible to hospitalize the hypochondriac
    on with the value numberOfHospitalize that his small from 5 and if he will hospitalize he will return
    the value true.
    3. write class PatientClass which will be the method main.
    do 10 objects from OrdinaryPatient, 5 that don't get values and 5 will get randomaly age and
    chronic disease with true.
    do 10 objects from Hipochonidraic, 9 that don't get values and one get all of them.
    save all objects in value from Patinet.
    print for each of them their age.
    print for the OrdinaryPatient alone the method of Hospitalize.
    ok, here's what I did.
    1. OrdinaryPatient
    pbulic class OrdinaryPatient implements Patient{
    private int age;
    private boolean disease;
    public OrdinaryPatient(){
    this.disease=false;
    this.age=0;
    public OrdinaryPatient(int age,boolean ddisase){
    this.disease=disease;
    this.age=age;
    public int getAge(){
    return age;
    public void setDisease(boolean disease){
    this.disease=disease;
    public void setAge(int age){
    this.age=age;
    public void docVisit(){
    System.out.println("Patient's visit is one hour");
    public boolean hospitalize(){
    return false;
    2. public class Hipochondriac extends OrdinaryPatient{
    private = numberOfHospitalize;
    public Hipochondriac();
    super();
    numberOfHospitalize=0;
    public Hipochondriac(int age, boolean diseased, int numberOfHospitalize){
    super(age.diseased);
    setnumberOfHospitalize(numberofHospitalize);
    from here I don't know how to continue.
    3. public class PatientClass{
    public static void main(String args[]){
    patient patinets= new patient[20];
    for (int i=0; i<5; i++){
    patients= new OrdinaryPatient();
    from i'm stuck!!!
    if you can help me to improve it I will appriciate it...
    Einat

    here my result.
    1. public interface Patient{
         public void docVisit(float hour_;
         public boolean hospitalize();
    public class OrdinaryPatient extends Patient
         private int age;
         private boolean disease;
    //constructors
         public OrdinaryPatient(){
              age=20;
              disease=true;
         public OrdinaryPatient(int age, boolean disease) {
              setAge(age);
              this.disease=disease;
    //methods
         public int getAge() {
              return age;
         public void setAge(boolean disease) {
              if(age>0 && age<120)
                   this.age=age;
         //overriding methods.
         public void docVisit(float hour) {
              System.out.println("your visit turn is at "+hour");
         public boolean hospitalize(){
              System.out.println("go to hospital");
              if(disease)
                   return true;
              else
                   return false;
    2. public class Hipochondriac extends OrdinaryPatient{
         private int numberOfHospitalize;
    //constructors
         public Hipochondriac(){
         public Hipochondriac(int age, boolean disease, int numberOfHospipitalize){
              setAge(age);
              this.disease=disease;
              this.numberOfHospitalize=numberOfHospitalize
         //methods
         public int getNumberOfHospitalize(){
              return numberOfHospitalize;
         public void setNumberOfHospitalize(int numberOfHostpitalize){
              if(numberOfHospitalize>0)
                   this.numberOfHospitalize=numberOfHospitalize;
         public boolean hospitalize(){
              if(numberOfHospitalize<5)
                   System.out.println("go to hospital");
                   numberOfHospitalize++;
                   return true;
              else
                   return false;
    3. public class PatientClass
         //constructors
         private PatientClass(String[] args){
              //private methods helps to build the object.
              intialArr(args);
              printAge();
              gotHospital();
    //methods.
    private void intialArr(String[] args){
         int i;//array index
         for(i=0;i<arr.lents/2;i+=2)
              arr=new OrdinaryPatient();
              arr[i+1]=new OridnaryPatient((int)(Math.random()*121),true);
         for(;i<=arr.length-2;i++)
              arr[i]=new Hipochondriac();
         arr[i]=new Hipochondriac(Interget.parseINt(args[0]),
         private void printAge(){
              for(int i=0;i<arr.length;i++)
                   System.out.println(((OrdinaryPatient)arr[i]).getAge());
         private void gotoHospital(){
              for(int i=0;i<arr.length;i++)
    //checking for ordinarypatient objects only
                   if(!(arr[i] instanceof Hipochondriac))
                        //dont need casting
                        arr[i].hospitalize()[
         //main method
         public static void main(String[] args)
              //setting the commandLine array from the main to PatientClass object
              PatientClass pc=new PatientClass(args);
    let me know if it's seems logic to you.
    thank you, Einat     

  • Need help in writing the code

    Hi,
    My table data is as below.
    Kunnr  BDAT EDAT  D1 D2 D3 D4 D5
    1111    2001  2002   1      2    1      2     1
    1111    2003  2008   1      0    4     1      2
    1111    2008  2011   1      1    1     1      1
    2222    2003  2008   1      2    2             2
    2222    2008  2011           1    2     1      1
    Here for kunnr  between begin and end date we have to caluclate the dependencies. (I.e if there is any value in D1or D2 or D3orD4 it shoulbe counted as 1. of it is zero or blank then it should not be coutned).
    for Ex: for 1111 between 2001 & 2002 tot dependencies are 5.            
               for 1111 between 2003 & 2008 tot dependencies are 4.
    in this scenario what will be the best way of writing the code. Do we need to check each and every field when counting the Sum value or and simple way to improve the performance.
    Regards,
    Vishnu
    Edited by: Vishnuvadhan K on May 13, 2011 10:30 AM
    Moderator Message: This is not a forum, where you can get your work done by others.
    Edited by: kishan P on May 13, 2011 3:52 PM

    Hi Vishnu,
    Here, you will have to check for the range of your begin date & end date. If it comes in the said range, then you simply have to add the values of your D1, D2,... DX values which you can store in some variables by setting out a flag as one counter for each.
    If your case is satisfied for any of the date range, then just check for the flag values which are satisfied & add them or display the sum of the number of counters.
    @Ambujavalli, At End Of won't work here because the date ranges given by Vishnu will differ.
    Those statements are useful in a case when suppose for the same field value, you need to calculate a particular sum.
    Here, that is not the case. Hence, AT First & At End Of won't work.
    Thanks,
    Gayathri.
    Edited by: gnikesh88 on May 13, 2011 11:52 AM

  • Need help to check the code!

    In my program its not giving data for any value of VBELN.What is the reason !
    I am only getting one record between 3000 and 5000 ! What is wrong here!
    REPORT YINTERACTIVEPROGRAM01.
    TABLES:VBAP,
           VBPA,
           vbak,
           VBRP,
           VBRK,
           KNA1,
           ADRC,
           TPAR,
           TVKGG,
           TVM1T,
           TVM2T,
           TVM3T,
           TVM4T,
           VBKD,
           SZA1_D0100,
           TVLVT,
           T002,
           T178T.
    Select-options S_VBELN for vbak-vbeln.
    TYPES:BEGIN OF TY_TAB,
             VBELN LIKE VBAK-VBELN,
             VKORG LIKE VBAK-VKORG,
             ERDAT LIKE VBAK-ERDAT,
             AUGRU LIKE VBAK-AUGRU,
             BSTDK LIKE VBKD-BSTDK,
             BSTDK_E LIKE VBKD-BSTDK_E,
             spart like vbap-spart,
             kondm like vbap-kondm,
             waerk like vbap-waerk,
             netwr like vbap-netwr,
             kwmeng like vbap-kwmeng,
             vkaus like vbap-vkaus,
             land1 like vbpa-land1,
             nrart like tpar-nrart,
           vtext like tpar-vtext,
             parvw like tpar-parvw,
             name1 like adrc-name1,
             name2 like adrc-name2,
             name3 like adrc-name3,
             name4 like adrc-name4,
             ort01 like kna1-ort01,
             pstlz like kna1-pstlz,
             vtext like t178t-vtext,
             bezei1 like tvm1t-bezei,
             bezei2 like tvm2t-bezei,
             bezei3 like tvm3t-bezei,
             bezei4 like tvm4t-bezei,
             bezei5 like tvm5t-bezei,
             BEZEI like tvlvt-bezei,
             spras like t002-spras,
             laspez like t002-laspez,
         END  OF TY_TAB.
    DATA: ITAB TYPE STANDARD TABLE OF TY_TAB WITH HEADER LINE.
    *parameters:salesno like itab-vbeln.
    select s1~vbeln
           s1~vkorg
           s1~erdat
           s1~augru
           k1~BSTDK
           k1~BSTDK_E
           p1~spart
           p1~kondm
           p1~waerk
           p1~netwr
           p1~kwmeng
           p1~vkaus
           r1~land1
           t1~nrart
          t1~vtext
           t1~parvw
           n1~name1
           n1~name2
           n1~name3
           n1~name4
           c1~ort01
           c1~pstlz
           x1~vtext
           t2~BEZEI
           b1~bezei
           b2~bezei
           b3~bezei
           b4~bezei
           b5~bezei
           t3~spras
           t3~laspez
    into corresponding fields of table itab
    from  vbak as s1
    join  VBKD as k1
    on   s1vbeln = k1VBELN
    join vbap as p1
    on   k1vbeln = p1vbeln
    join t178t as x1
    on   p1kondm = x1kondm
    join vbpa as r1
    on   p1vbeln = r1vbeln
    join tpar as t1
    on   r1parvw = t1parvw
    join ADRC as n1
    on   r1adrnr = n1addrnumber
    join kna1 as c1
    on   r1land1 = c1land1
    join tvlvT as t2
    on p1vkaus =  t2abrvw
    join t002 as t3
    on c1spras = t3spras
    join tvm1t as b1
    on c1spras = b1spras
    AND p1mvgr1 = b1mvgr1
    join tvm2t as b2
    on c1spras = b2spras
    AND p1mvgr2 = b2mvgr2
    join tvm3t as b3
    on c1spras = b3spras
    AND p1mvgr3 = b3mvgr3
    join tvm4t as b4
    on c1spras = b4spras
    AND p1mvgr4 = b4mvgr4
    join tvm5t as b5
    on c1spras = b5spras
    AND p1mvgr5 = b5mvgr5
    up to 10 rows
    WHERE S1~VBELN IN S_VBELN.
    loop AT ITAB.
      WRITE : /(30)'VBELN: ',  ITAB-VBELN,
              /(30)'VKORG: ',  ITAB-VKORG,
              /(30)'ERDAT: ',  ITAB-ERDAT,
              /(30)'AUGRU: ',  ITAB-AUGRU,
              /(30)'BSTDK: ',  ITAB-BSTDK,
              /(30)'BSTDK_E:', ITAB-BSTDK_E,
              /(30)'SPART: ',  itab-spart,
              /(30)'KONDM: ',  itab-kondm,
              /(30)'WAERK: ',  itab-waerk,
              /(19)'NETWR: ' , itab-netwr,
              /(17)'KWMENG: ', itab-kwmeng,
              /(30)'VKAUS:',   itab-vkaus,
              /(30)'LAND1:',   itab-land1,
              /(30)'NRART:',   itab-nrart,
              /(30)'PARVW:',   itab-parvw,
              /(30)'ADDR1:',   itab-name1,
              /(30)'ADDR2:',   itab-name2,
              /(30)'ADDR3:',   itab-name3,
              /(30)'ADDR4:',   itab-name4,
              /(30)'PSTLZ:',   itab-pstlz,
              /(30)'ORT01:',   itab-ort01,
              /(30)'RUN TIME BAND DESC:',   itab-BEZEI,
              /(30)'Compiler desc:',itab-vtext,
              /(30)'BEZEI:',    itab-bezei,
              /(30)'BEZEI1:',   itab-BEZEI1,
              /(30)'BEZEI2:',   itab-BEZEI2,
              /(30)'BEZEI3:',   itab-BEZEI3,
              /(30)'BEZEI4:',   itab-BEZEI4,
              /(30)'BEZEI5:',   itab-bezei5,
              /(30)'LASPEZ :',  itab-LASPEZ,
              /(30)'spras :', itab-spras.
             uline.
    ENDLOOP.
                if sy-subrc <> 0.
                write : / 'No data found'.
                endif.

    FIRST CHECK IN THE TABLE WHETHER DATA IS PRESENT  OR NOT FOR THIS PARTICULAR SELECTION CRITERIA.
    and secondly i would like to suggest you that dont use inner join on so many tables instead use FOR ALL ENTRIES and after every SELECT statement check whether that table is initial.
    may be any of the table does not contain data for that criteria thats y it may not be displaying anything.

  • Need to close only the new popup window

    Could anyone please help me with this.
    From Main.java, the main user interface pops up, on clicking vf2vpExebut button, vf2vpExe.java's user interface pops up. After I process the vf2vpExe.java user interface and close it even my Main.java user interface closes.
    But on clicking the exitbut in vf2vpExe.java, I need to close only the vf2vpExe.java user interface and not Main.java user interface also.
    My code is:
    Main.java
    private void vf2vpExebutActionPerformed(java.awt.event.ActionEvent evt)
         try
              vf2vpExe vf=new vf2vpExe();
              vf.mainclass();
         catch(Exception e)
    } vf2vpExe.java
    private void exitbutActionPerformed(java.awt.event.ActionEvent evt)
         System.exit(0);
    }

    Please ignore this topic. I need to post this in New to Java

  • How to assign transaction code to a ABAP program?

    Hi,
    Need help in assigning transaction code to a ABAP program. Any method that will do the job?

    >
    sainath raj wrote:
    > hi
    > within my knowledge
    > Any ABAP program can have its own transaction code if and only if it is of type 'MODULE POOL' .
    > An EXECUTABLE program  cannot have a transaction code.
    >
    > So try with this .
    >  1) Go to the attributes of the program and change the program as type module pool
    >   2) then execute transaction SE93.
    >  3) give the appropriate program name and assign a transaction code as ur wish.
    Well Sainath,
    What u said is not correct, an executable report can have a transaction code, difference between module pool and executable program is that u neccesarily need to have a tcode for module pool but that doesn't mean that only module pool can have tcode.
    And secondly u should not answer these kind of simple questions, as people then continue posting simple questions without making an effort to serach for themselves.
    кu03B1ятu03B9к.

  • OIC: Need to find the Source Code for the YTDSummary.java file

    Hi All,
    We have 11.5.10 implemention and we are using the OIC(Incentive Compensation) Application. In the Report Module for the Year-To-Date Summary we need look for the Java Source Code.The cnytdsum.jsp file call the YTDSummary.java file. We have teh following question
    1. How we can get the Java Source Code and where and which directory we need to look into?
    2. Let say if we need to customize the java file how we can do that?
    3. where and which directory we have to complie the java file?
    Highly appreciate for any pointers
    Thanks,
    Johnson.

    But those must be platform dependant, not really that
    interesting to look at. I have never felt any need to
    look at those at least.Wake up and smell the coffee, abbie! I read the source code all the time and constantly tell my students to do that, too.
    1. Java source code is not platform dependent. The original poster wanted to look at linked list code, how could that be platform dependent?
    2. It is the implementation of the SDK APIs, so by definition it is implementation dependent code, liable to change in a later version. So don't assume anything beyond what is claimed in the API documentation. However, sometimes the documentation is incomplete or ambiguous to you, and reading the source can provide some insight, however implementation dependent. (Light a candle or curse the darkness.)
    3. Why read source code? It's a good way to learn how to program. You see something in the API and ask: how'd they do that? Or you realize you want to do something broadly similar, but you can't reuse the source code.
    For example, Images are not Serializable, but suppose you want a small image that is part of an object to be serialized with the rest of the object without too much fuss (ie, without using javax.imageio). You notice ImageIcon is serializable, so you use it. (An ImageIcon has-an Image.) Then you wonder: how'd they do that? You read the source and then you know.
    You live, you learn,
    Nax

  • How to do implement the FrameAccess.java code in my project

    Iam doing an project in java for inserting the videos into oracle9i and searching the inserted videos using the frames of the videos inserted.I have done the project to insert and search the videos.But i have been asked to put an EXTRACT button to extract all the frames of the video being inserted.Please help me to implement the FrameAccess.java coding in my existing coding.I have pasted my coding(VideoInsert.java) and FrameAccess.java(used to extract frames) coding.
    The VideoInsert.java when executed will contain browse button to choose the video file(only .mpg files) to be inserted into the database.After selecting the file and when we press open button in the Open dialog box,the video will be played in jmf player in a separate window and the filepath of the video will be included in the textbox.Now what i need is,an extract button should be placed and when it is clicked,the frames of the corresponding selected video has to be extracted in the location where the project files are stored i.e.,the FrameAccess.java coding has to be executed.
    Please help me if anyone knows how to implement the above concept.
    VideoInsert.java
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    import oracle.sql.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import oracle.sql.BLOB ;
    import symantec.itools.multimedia.ImageViewer;
    public class VideoInsert extends javax.swing.JFrame {
        private Connection con;
        private Statement st=null;
        private OracleResultSet rs=null;
        int count=0;
        int count1=0;
        ImageViewer displaywindow = new ImageViewer();
        /** Creates new form VideoInsert */
        public VideoInsert() {
            initComponents();
            imgpane.add(displaywindow);
            try {
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                con = DriverManager.getConnection("jdbc:oracle:oci:@","scott","tiger");
                  //con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:FIRST","scott","tiger");
                con.setAutoCommit(false);
                st =con.createStatement();
                rs=(OracleResultSet)st.executeQuery("select max(vid) from browsevideo");
                while (rs.next()) {
                    count = (rs.getInt(1) + 1);
                rs.close();
                st =con.createStatement();
                rs=(OracleResultSet)st.executeQuery("select max(imageno) from browseimage");
                while (rs.next()) {
                    count1 = (rs.getInt(1) + 1);
                rs.close();
            } catch (SQLException e) {
                e.printStackTrace();
            txtvid.setText(String.valueOf(count));
             VideoTypeComboBox.addItem("All");
            VideoTypeComboBox.addItem("Entertainment");
            VideoTypeComboBox.addItem("Sports");
            VideoTypeComboBox.addItem("Animation");
            VideoTypeComboBox.addItem("News");
             VideoTypeComboBox.addItem("Others");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {//GEN-BEGIN:initComponents
            jLabel1 = new javax.swing.JLabel();
            txtvid = new javax.swing.JTextField();
            jLabel2 = new javax.swing.JLabel();
            txtvidfile = new javax.swing.JTextField();
            jLabel3 = new javax.swing.JLabel();
            txtvidinfo = new javax.swing.JTextField();
            jLabel4 = new javax.swing.JLabel();
            txtimgfile = new javax.swing.JTextField();
            vidbrowse = new javax.swing.JButton();
            imgbrowse = new javax.swing.JButton();
            jLabel5 = new javax.swing.JLabel();
            txtimgcont = new javax.swing.JTextField();
            insert = new javax.swing.JButton();
            imgpane = new javax.swing.JPanel();
            jLabel6 = new javax.swing.JLabel();
            VideoTypeComboBox = new javax.swing.JComboBox();
            getContentPane().setLayout(null);
            setTitle("VideoInsert");
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jLabel1.setText("Video ID");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(30, 80, 90, 16);
            txtvid.setEditable(false);
            getContentPane().add(txtvid);
            txtvid.setBounds(130, 80, 130, 20);
            jLabel2.setText("VideoFile");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(30, 130, 70, 16);
            getContentPane().add(txtvidfile);
            txtvidfile.setBounds(130, 130, 130, 20);
            jLabel3.setText("VideoInfo");
            getContentPane().add(jLabel3);
            jLabel3.setBounds(30, 180, 80, 16);
            getContentPane().add(txtvidinfo);
            txtvidinfo.setBounds(130, 180, 130, 20);
            jLabel4.setText("TopImage");
            getContentPane().add(jLabel4);
            jLabel4.setBounds(30, 230, 70, 16);
            getContentPane().add(txtimgfile);
            txtimgfile.setBounds(130, 230, 130, 20);
            vidbrowse.setText("Browse");
            vidbrowse.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    vidbrowseActionPerformed(evt);
            getContentPane().add(vidbrowse);
            vidbrowse.setBounds(280, 130, 78, 26);
            imgbrowse.setText("Browse");
            imgbrowse.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    imgbrowseActionPerformed(evt);
            getContentPane().add(imgbrowse);
            imgbrowse.setBounds(280, 230, 78, 26);
            jLabel5.setText("ImageContent");
            getContentPane().add(jLabel5);
            jLabel5.setBounds(30, 280, 80, 16);
            getContentPane().add(txtimgcont);
            txtimgcont.setBounds(130, 280, 130, 20);
            insert.setText("Insert");
            insert.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    insertActionPerformed(evt);
            getContentPane().add(insert);
            insert.setBounds(150, 400, 81, 26);
            imgpane.setLayout(new java.awt.BorderLayout());
            getContentPane().add(imgpane);
            imgpane.setBounds(410, 120, 350, 260);
            jLabel6.setText("Video Type");
            getContentPane().add(jLabel6);
            jLabel6.setBounds(30, 340, 80, 16);
            getContentPane().add(VideoTypeComboBox);
            VideoTypeComboBox.setBounds(130, 340, 130, 25);
            pack();
            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setSize(new java.awt.Dimension(800, 600));
            setLocation((screenSize.width-800)/2,(screenSize.height-600)/2);
        }//GEN-END:initComponents
        private void insertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_insertActionPerformed
            BLOB blb= null;
            PreparedStatement stmt = null;
            OutputStream fout=null;
            File f=null;
            FileInputStream fin=null;
            int bufferSize;
            byte[] buffer=null;
            int bytesRead = -1;
            String sfile1 = txtvidfile.getText();
            String sfile2 = txtimgfile.getText();
            String format=null;
            String format1=null;
            String videoinfo=txtvidinfo.getText();
            String imgcontent=txtimgcont.getText();
            String videoType=(String)VideoTypeComboBox.getSelectedItem();
            if(sfile1.endsWith("avi")) {
                format="avi";
            }else if(sfile1.endsWith("mpg")) {
                format="mpg";
            }else {
                format="mpg";
            if(sfile2.endsWith("jpg")) {
                format1="jpg";
            }else if(sfile2.endsWith("gif")) {
                format1="gif";
            }else {
                format1="jpg";
            if((sfile1.length()>0) && (sfile2.length()>0)) {
                try {
                    stmt=con.prepareStatement(" insert into browsevideo values (?,EMPTY_BLOB(),?,?,?)");
                    stmt.setInt(1,count);
                    stmt.setString(2,format);
                    stmt.setString(3,videoinfo);
                     stmt.setString(4,videoType);
                    stmt.executeUpdate();
                    stmt.close();
                    con.commit();
                }catch(Exception e) {
                    e.printStackTrace();
                try {
                    stmt = con.prepareStatement("Select video FROM browsevideo WHERE vid = ? for update of video");
                    stmt.setInt(1,count);
                    rs = (OracleResultSet)stmt.executeQuery();
                    rs.next();
                    blb = rs.getBLOB("video");
                    fout = blb.getBinaryOutputStream();
                    f = new File(sfile1);
                    fin = new FileInputStream(f);
                    bufferSize = blb.getBufferSize();
                    buffer = new byte[bufferSize];
                    while((bytesRead = fin.read(buffer)) != -1) {
                        fout.write(buffer, 0, bytesRead);
                    fout.flush();
                    fout.close();
                    con.commit();
                    rs.close();
                    stmt.close();
                }catch(Exception e) {
                    e.printStackTrace();
                try {
                    stmt=con.prepareStatement(" insert into browseimage values (?,?,?,EMPTY_BLOB(),?,?,?)");
                    stmt.setInt(1,count);
                    stmt.setInt(2,count1);
                    stmt.setInt(3,count1);
                    stmt.setString(4,imgcontent);
                    stmt.setString(5,format1);
                    stmt.setString(6,videoType);
                    stmt.executeUpdate();
                    stmt.close();
                    con.commit();
                }catch(Exception e) {
                    e.printStackTrace();
                try {
                    stmt = con.prepareStatement("Select image FROM browseimage WHERE imageno = ? for update of image");
                    stmt.setInt(1,count1);
                    rs = (OracleResultSet)stmt.executeQuery();
                    if(rs.next()) {
                        blb = rs.getBLOB("image");
                        fout = blb.getBinaryOutputStream();
                        f = new File(sfile2);
                        fin = new FileInputStream(f);
                        bufferSize = blb.getBufferSize();
                        buffer = new byte[bufferSize];
                        while((bytesRead = fin.read(buffer)) != -1) {
                            fout.write(buffer, 0, bytesRead);
                        fout.flush();
                        fout.close();
                        con.commit();
                        rs.close();
                    stmt.close();
                    count++;
                    count1++;
                    txtimgfile.setText("");
                    txtvidfile.setText("");
                    txtimgcont.setText("");
                    txtvidinfo.setText("");
                    txtvid.setText(String.valueOf(count));
                    JOptionPane.showMessageDialog(this,"Successfuly Completed");
                }catch(Exception e) {
                    e.printStackTrace();
        }//GEN-LAST:event_insertActionPerformed
        private void imgbrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imgbrowseActionPerformed
            ExampleFileFilter filter1 = new ExampleFileFilter();
            JFileChooser chooser = new JFileChooser();
            filter1.addExtension("jpg");
            filter1.addExtension("gif");
            filter1.setDescription("JPG,GIF Images");
            chooser.setFileFilter(filter1);
            int returnVal = chooser.showOpenDialog(this);
            if(returnVal == JFileChooser.APPROVE_OPTION) {
                txtimgfile.setText(chooser.getSelectedFile().getAbsolutePath());
                try{
                        displaywindow.setImageURL(new java.net.URL("file:"+txtimgfile.getText()));
                        displaywindow.setStyle(ImageViewer.IMAGE_SCALED_TO_FIT);
                    }catch(Exception e){
                        e.printStackTrace();
        }//GEN-LAST:event_imgbrowseActionPerformed
        private void vidbrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vidbrowseActionPerformed
           ExampleFileFilter filter2 = new ExampleFileFilter();
           JFileChooser chooser = new JFileChooser();
           filter2.addExtension("avi");
            filter2.addExtension("mpg");
            filter2.setDescription("AVI & MPG Video");
            chooser.setFileFilter(filter2);
            int returnVal = chooser.showOpenDialog(this);
            if(returnVal == JFileChooser.APPROVE_OPTION) {
                txtvidfile.setText(chooser.getSelectedFile().getAbsolutePath());
                VideoAudioPlayer vap=new VideoAudioPlayer(txtvidfile.getText());
        }//GEN-LAST:event_vidbrowseActionPerformed
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
            setVisible(false);
            dispose();
        }//GEN-LAST:event_exitForm
         * @param args the command line arguments
        /*public static void main(String args[]) {
            new VideoInsert().show();
        // Variables declaration - do not modify//GEN-BEGIN:variables
        private javax.swing.JButton imgbrowse;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JTextField txtvid;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JTextField txtimgcont;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JPanel imgpane;
        private javax.swing.JButton insert;
        private javax.swing.JComboBox VideoTypeComboBox;
        private javax.swing.JButton vidbrowse;
        private javax.swing.JTextField txtvidfile;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JTextField txtimgfile;
        private javax.swing.JTextField txtvidinfo;
        // End of variables declaration//GEN-END:variables
    FrameAccess.java
    import java.awt.*;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.Format;
    import javax.media.format.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.awt.image.*;
    import java.util.*;
    import javax.media.util.*;
    * Sample program to access individual video frames by using a
    * "pass-thru" codec. The codec is inserted into the data flow
    * path. As data pass through this codec, a callback is invoked
    * for each frame of video data.
    public class FrameAccess implements ControllerListener {
         Processor p;
         Object waitSync = new Object();
         boolean stateTransitionOK = true;
         public boolean alreadyPrnt = false;
         * Given a media locator, create a processor and use that processor
         * as a player to playback the media.
         * During the processor's Configured state, two "pass-thru" codecs,
         * PreAccessCodec and PostAccessCodec, are set on the video track.
         * These codecs are used to get access to individual video frames
         * of the media.
         * Much of the code is just standard code to present media in JMF.
         public boolean open(MediaLocator ml) {
              try {
                   p = Manager.createProcessor(ml);
                                } catch (Exception e) {
                   System.err.println(
                        "Failed to create a processor from the given url: " + e);
                   return false;
              p.addControllerListener(this);
              // Put the Processor into configured state.
              p.configure();
              if (!waitForState(Processor.Configured)) {
                   System.err.println("Failed to configure the processor.");
                   return false;
              // So I can use it as a player.
              p.setContentDescriptor(null);
              // Obtain the track controls.
              TrackControl tc[] = p.getTrackControls();
              if (tc == null) {
                   System.err.println(
                        "Failed to obtain track controls from the processor.");
                   return false;
              // Search for the track control for the video track.
              TrackControl videoTrack = null;
              for (int i = 0; i < tc.length; i++) {
                   if (tc.getFormat() instanceof VideoFormat) videoTrack = tc[i];
                   else     tc[i].setEnabled(false);
              if (videoTrack == null) {
                   System.err.println("The input media does not contain a video track.");
                   return false;
              String videoFormat = videoTrack.getFormat().toString();
              Dimension videoSize = parseVideoSize(videoFormat);
              System.err.println("Video format: " + videoFormat);
              // Instantiate and set the frame access codec to the data flow path.
              try {
                   Codec codec[] = { new PostAccessCodec(videoSize)};
                   videoTrack.setCodecChain(codec);
              } catch (UnsupportedPlugInException e) {
                   System.err.println("The process does not support effects.");
              // Realize the processor.
              p.prefetch();
              if (!waitForState(Processor.Prefetched)) {
                   System.err.println("Failed to realise the processor.");
                   return false;
              p.start();
              return true;
         /**parse the size of the video from the string videoformat*/
         public Dimension parseVideoSize(String videoSize){
              int x=300, y=200;
              StringTokenizer strtok = new StringTokenizer(videoSize, ", ");
              strtok.nextToken();
              String size = strtok.nextToken();
              StringTokenizer sizeStrtok = new StringTokenizer(size, "x");
              try{
                   x = Integer.parseInt(sizeStrtok.nextToken());
                   y = Integer.parseInt(sizeStrtok.nextToken());
              } catch (NumberFormatException e){
                   System.out.println("unable to find video size, assuming default of 300x200");
              System.out.println("Image width = " + String.valueOf(x) +"\nImage height = "+ String.valueOf(y));
              return new Dimension(x, y);
         * Block until the processor has transitioned to the given state.
         * Return false if the transition failed.
         boolean waitForState(int state) {
              synchronized (waitSync) {
                   try {
                        while (p.getState() != state && stateTransitionOK)
                             waitSync.wait();
                   } catch (Exception e) {
              return stateTransitionOK;
         * Controller Listener.
         public void controllerUpdate(ControllerEvent evt) {
              if (evt instanceof ConfigureCompleteEvent
                   || evt instanceof RealizeCompleteEvent
                   || evt instanceof PrefetchCompleteEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = true;
                        waitSync.notifyAll();
              } else if (evt instanceof ResourceUnavailableEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = false;
                        waitSync.notifyAll();
              } else if (evt instanceof EndOfMediaEvent) {
                   p.close();
                   System.exit(0);
         * Main program
         public static void main(String[] args) {
    //          if (args.length == 0) {
    //               prUsage();
    //               System.exit(0);
    // System.out.print("masoud");
    String url = new String("file:F:\\AVSEQ01.mpg");
              if (url.indexOf(":") < 0) {
                   prUsage();
                   System.exit(0);
              MediaLocator ml;
              if ((ml = new MediaLocator(url)) == null) {
                   System.err.println("Cannot build media locator from: " + url);
                   System.exit(0);
              FrameAccess fa = new FrameAccess();
              if (!fa.open(ml))
                   System.exit(0);
         static void prUsage() {
              System.err.println("Usage: java FrameAccess <url>");
         * Inner class.
         * A pass-through codec to access to individual frames.
         public class PreAccessCodec implements Codec {
              * Callback to access individual video frames.
              void accessFrame(Buffer frame) {
                   // For demo, we'll just print out the frame #, time &
                   // data length.
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println(
                        "Pre: frame #: "
                             + frame.getSequenceNumber()
                             + ", time: "
                             + ((float) t) / 100f
                             + ", len: "
                             + frame.getLength());
              * The code for a pass through codec.
              // We'll advertize as supporting all video formats.
              protected Format supportedIns[] = new Format[] { new VideoFormat(null)};
              // We'll advertize as supporting all video formats.
              protected Format supportedOuts[] = new Format[] { new VideoFormat(null)};
              Format input = null, output = null;
              public String getName() {
                   return "Pre-Access Codec";
              //these dont do anything
              public void open() {}
              public void close() {}
              public void reset() {}
              public Format[] getSupportedInputFormats() {
                   return supportedIns;
              public Format[] getSupportedOutputFormats(Format in) {
                   if (in == null)
                        return supportedOuts;
                   else {
                        // If an input format is given, we use that input format
                        // as the output since we are not modifying the bit stream
                        // at all.
                        Format outs[] = new Format[1];
                        outs[0] = in;
                        return outs;
              public Format setInputFormat(Format format) {
                   input = format;
                   return input;
              public Format setOutputFormat(Format format) {
                   output = format;
                   return output;
              public int process(Buffer in, Buffer out) {
                   // This is the "Callback" to access individual frames.
                   accessFrame(in);
                   // Swap the data between the input & output.
                   Object data = in.getData();
                   in.setData(out.getData());
                   out.setData(data);
                   // Copy the input attributes to the output
                   out.setFlags(Buffer.FLAG_NO_SYNC);
                   out.setFormat(in.getFormat());
                   out.setLength(in.getLength());
                   out.setOffset(in.getOffset());
                   return BUFFER_PROCESSED_OK;
              public Object[] getControls() {
                   return new Object[0];
              public Object getControl(String type) {
                   return null;
         public class PostAccessCodec extends PreAccessCodec {
              // We'll advertize as supporting all video formats.
              public PostAccessCodec(Dimension size) {
                   supportedIns = new Format[] { new RGBFormat()};
                   this.size = size;
              * Callback to access individual video frames.
              void accessFrame(Buffer frame) {
                   // For demo, we'll just print out the frame #, time &
                   // data length.
                   if (!alreadyPrnt) {
                        BufferToImage stopBuffer = new BufferToImage((VideoFormat) frame.getFormat());
                        Image stopImage = stopBuffer.createImage(frame);
                        try {
                             BufferedImage outImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
                             Graphics og = outImage.getGraphics();
                             og.drawImage(stopImage, 0, 0, size.width, size.height, null);
                             //prepareImage(outImage,rheight,rheight, null);
                             Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
                             ImageWriter writer = (ImageWriter) writers.next();
                             //Once an ImageWriter has been obtained, its destination must be set to an ImageOutputStream:
                             File f = new File(frame.getSequenceNumber() + ".jpg");
                             ImageOutputStream ios = ImageIO.createImageOutputStream(f);
                             writer.setOutput(ios);
                             //Finally, the image may be written to the output stream:
                             //BufferedImage bi;
                             //writer.write(imagebi);
                             writer.write(outImage);
                             ios.close();
                        } catch (IOException e) {
                             System.out.println("Error :" + e);
                   //alreadyPrnt = true;
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println(
                        "Post: frame #: "
                             + frame.getSequenceNumber()
                             + ", time: "
                             + ((float) t) / 100f
                             + ", len: "
                             + frame.getLength());
              public String getName() {
                   return "Post-Access Codec";
              private Dimension size;

    check out the java.lang.Runtime and java.lang.Process classes

  • How to create a movie file of java 3D animation without altering the code?

    Is there a way to create a movie file of a Java 3D animation without altering the source code of the Java 3D animation program???
    Because as what I observed, most of the forum recommends extracting the bufferedimages of the animation. And, then using the bufferedimages to do a movie file. In this way, I will need to add in new code in the animation program in order to extract the bufferedimages.
    So, is there an alternative way?
    My objective is write a program to create movie file of any Java 3D animation.
    Pls advise me. Thanks a million.

    I'm curious as to why FRAPS will record java3d and
    not a java2d app? is there something that Java3d
    sets that makes it recognizable by fraps? or?? could
    someone or messengers ( =D!) explain this for me?Seems that only in JDK 5.0 or later, does the 2D api automatically use a DirectX or OpenGL rendering pipeline (if available).
    Further, these automatic pipelines accelerate polygons and the like, but not low level Graphics2D bit blitting operations.
    There are JOGL apis that allow better control over acceleration, and are considered 'thread safe' (single threaded) whereas DirectX pipelines are not.
    Interesting demos of this here:
    https://jogl-demos.dev.java.net/applettest.html
    and
    http://www.hardcorepawn.com/RandomGL/
    Fraps (commercial) and Taksi (opensource) will reveal that you are actually using acceleration, since they intercept the pipeline at the openGL (and DirectX) level.

  • I need the code to delete record in the database not in the form???

    I need the code to delete record in the database not in the form...
    because when i execute a form always insert the datas in the data base but i want insert value on a text file and delete in the data base the record whith this value of text file.
    i'm spanish an my english is bad sorry.
    thank, javier

    Well, I fail to understand why you want to complicate easy things, but anyway you can do that by using TEXT_IO within Forms to create text file (see Forms builder help), and UTL_FILE package to read it within Pl/Sql : you could create a stored procedure, and call it from Forms passing the file name as parameter. See UTL_FILE documentation

  • Need someone to chek my code n tell me if the asserts work. Please!!

    Hi , its importante that someone could help me on my code.
    the code is the greatest common divisor ( Maximo divisor comum)
    Well , the code is all right but i can't run it with the asserts , im using Eclipse 3.1 , the level of compilation is 1.3 .
    It says that ignores de asserts but when i compile it gives me error on assert expression.
    I would like to someone could test this code in another JAva editor like XEmacs or JBuilder ,anything that works with asserts and accept them.
    Someone working with linux could test this too?
    Just wanna see if the assertions are right , because i can't run the program with them in the eclipse. :S
    Its importante, help me please.
    Code:
    import pt.iscte.io.*;
    public class gCommonDivisor {
    public static void main(String[] args){
          assert 0 < n : n;     //  <--  THERE THEY ARE  : (
          assert 0 < d : d;  // n is the numerator and d is the denomi.
    System.out.println("Insira valor do numerador: ");
              int n = Teclado.intLido();
              System.out.println("Insira valor do denominador: ");
              int d = Teclado.intLido();
              int r = mdc( n, d); // modulo para o maximo divisor comum
              int den = denominador(r , d); // modulo para denominador simplificado
              int num = numerador(r, n); // modulo para numerador simplificado
              // Output do Maximo divisor comum e da frac�ao reduzida
              System.out.println("Maximo divisor comum entre "+ n +" e "+ d +" � "+ r);
              System.out.print("Frac��o reduzida de "+ n +"/"+ d +" = "+ num +"/"+ den);
               * @pre V.
               * @post gcd = maximo divisor comum
              static int mdc(int n, int d){
              int gcd = 1;
              int k =1;
              while (k <= n && k <= d) {
                   if (n % k == 0 && d % k == 0)
                        gcd =k;
                   k++;
                   return gcd;
              // numerador simplificado
              static int numerador(int r , int n ) {
              int numerador = n / r;
              return numerador;
              // denominador simplificado
              static int denominador(int r , int d ) {
              int denominador = d / r;
              return denominador;
    } Thank you so much .
    Please help me!
    Sorry about the language of the code. but dont worry about it, the code works fine without those two asserts after the main.
    kind regards,
    Josh

    wow i forgot to say that u just need to change the
    expression to read the input from the console.
    U dont have the iscte_io.jar
    change int n = Teclado.intLido();
    and int m = Teclado.intLido();
    cuz u don't have the Teclado( Keyboard) i had to import pt.iscte.io.Teclado;
    to read the input given by the user.
    thks

  • Please check the below Cursor Procedure and correct that code Please

    Hai Every One.
    Please check the below code I have two issues in that code
    1. Invalid cursor
    2. Record must be enter
    Please correct this code and send me pls its urgent.I cont understand where i done mistake
    PROCEDURE fetch_detail_PROC IS
    cursor c1 is select * from quota_mast where quota_mast.divn=:quota_mast.divn and quota_mast.QUOT_tyPE=:quota_mast.QUOT_tyPE and quota_mast.INQNO=:quota_mast.INQNO;
    cursor c6 is select * from quota_det
    where quota_det.divn=:quota_mast.divn AND quota_det.QUOT_TYPE=:quota_mast.QUOT_tyPE and quota_det.enq_num=:quota_mast.INQNO
    ORDER BY quota_det.quot_no;
    --cursor c5 is select * from acc_mst where cdp=:quota_mast.ccdp and divn=:quota_mast.divn;
    --vn acc_mst%rowtype;
    i quota_mast%rowtype;
    detail1 quota_det%rowtype;
    BEGIN
         GO_BLOCK('quota_mast');
    for i in c1 LOOP
              :quota_mast.INQNO:=i.INQNO;
                        :quota_mast.DIVN:=i.DIVN;
                   :quota_mast.QUOT_NO:=i.QUOT_NO;
                        :quota_mast.quot_type:=i.quot_type;
                        :quota_mast.CCDP:=i.CCDP;
                        select nm into :QUOTA_MAST.PARTY_NAME from acc_mst where acc_mst.DIVN=:QUOTA_MAST.DIVN AND acc_mst.cdp=:ccdp;
                        :quota_mast.pak_for:=i.pack_for_PER;
                        :quota_mast.exc_duty:=i.exc_duty_PER;
                        :quota_mast.vat:=i.vat_PER;
                        :quota_mast.cst:=i.cst_PER;
                        :quota_mast.wct:=i.wct_PER;
                        :quota_mast.ser_tax:=i.ser_tax_PER;
                        :quota_mast.insu:=i.insu_PER;
                        :quota_mast.tot_tax:=i.tot_tax;
                        :quota_mast.tot_val:=i.tot_val;
                   :quota_mast.value:=i.value;
                                  next_record;
    end loop;
         first_record;
    GO_BLOCK('quota_det');
                   for detail1 in c6
              loop
                        :quota_det.quot_no:=detail1.quot_no;
              :quota_det.ENQ_NUM:=detail1.enq_num;
              :quota_det.item_code:=detail1.item_code;
              SELECT ITNM into :NM FROM itm_MST WHERE DIVN=:quota_mast.DIVN AND iCDP=:ITEM_CODE;
              :quota_det.price:=detail1.price;
              :quota_det.qty:=detail1.qty;
              :quota_det.DISC_PER:=detail1.DISC_PER;
                   next_record;
    END LOOP;
         first_record;
    close c6;
    --close c1;
    exception
    when others then
    message(sqlerrm);
    message(' ');
    END;
    Thank you..

    Oracle Forms is closely tied to the database meaning you can base your data blocks on your tables and Forms will handle fetching the data. I agree with Christian, your tables lend themselves to using a master - detail configuration and if you need to filter your block then you can use the Data Block WHERE Clause property.
    Please correct this code and send me pls its urgent.As to the urgency of your request, the forum is a community of "Volunteers." Enough said.
    Regarding your code, I see a several potential problems.
    First, how are your QUOTA_MAST and QUOTA_DET blocks synchronized? Are you using a block relationship? Are you using a combination of triggers to synchonize the QUOTA_DET block when you user navigates to a different record in the QUOTA_MAST block?
    Second, your Procedure name is "Fetch_Detail_Proc" but you are also fetching Master data as well. What is the purpose of your procedure and where do you call this procedure?
    Third, you're using SELECT * in your cursor queries. You should always explicitly name each column. What happens when your table changes and you need to search your code for a column that was dropped?
    Fourth, your cursor queries are referencing the same data blocks you are fetching data to populate. This gives the impression that you already have data in your block. This doesn't make sense - could you explain what you are trying to accomplish?
    Fifth, with respects to your code, the "Invalid Cursor" error (is this really the error you're getting?) is most likely caused by your explicit call to close the C1 cursor. As Andreas stated, when using a CURSOR FOR LOOP, the cursor is automatically opened, fetched and closed using this construct. There is no need to explicitly close the cursor, in fact - doing so will result in an invalid cursor error.
    As to the "Record must be entered" error, is sounds like you have required items in your block or your QUOTA_MAST block is not synchronized with your QUOTA_DET block, so when you attempt to navigate to a different block or record within your the same block the navigation cursor can't move because you haven't entered data that is required.
    Please tell us what you are attempting to do with this code so we can tell you if you are using the correct method.
    Craig...

  • Hi I need this asap... "Java code to generate XML File from XML Schema"

    Hi all....
    I need this asap... "Java code to generate XML File from XML Schema i.e XML Schema Definition, XSD file".
    Thankz in advance...
    PS: I already posted in the afternoon... this is the second posting.

    take look at :
    http://sourceforge.net/projects/jaxme/
    this might help...

  • I need help in making the programe which updates our code into client machi

    I need help in making the programme which updates our code into client machine from the server.
    As yahoo messanger does if there is any updated version of yahoo messanger.
    It asks when we login into it do you want to update new version of yahoo messanger
    It automatically updates it
    Need Help??

    Sounds to me like you need Java Web Start.

Maybe you are looking for