How to inser data in database through programming

hi
if some one try to insert data directly in the data base that was displayed through programming then how can database will be updated
bye

hi
thanx 4 ur reply
but the tutorial is abt manullay changing the database through programming
but wat if user of the prgram change it and it will be change at the place of the database
bye

Similar Messages

  • How to create an Oracle DATABASE through Java Programming Language.. ?

    How to create an Oracle DATABASE through Java Programming Language.. ?

    Oracle database administrators tend to be control freaks, especially in financial institutions where security is paramount.
    In general, they will supply you with a database, but require you to supply all the DDL scripts to create tables, indexes, views etc.
    So a certain amount of manual installation will always be required.
    Typically you would supply the SQL scripts, and a detailled installation document too.
    regards,
    Owen

  • Its very urgent:how to insert data into database tables

    Hi All,
    I am very new to oaf.
    I have one requirement data insert into database tables.
    here createPG having data that data insert into one custom table.
    but i dont know how to insert data into database tables.
    i wrote the code in am,co as follows.
    in am i wrote the code:
    public void NewoperationManagerLogic()
    ManagerCustomTableVOImpl vo1=getManagerCustomTableVO1();
    OADBTransaction oadbt=getOADBTransaction();
    if(!vo1.isPreparedForExecution())
    vo1.executeQuery();
    Row row=vo1.createRow();
    vo1.insertRow(row);
    in createPG processrequest co:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.NewoperationManagerLogic();
    process form request:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.getParameter("Submit")!=null)
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.getOADBTransaction().commit();
    please help with an example(sample code).
    its very urgent.
    thanks in advance
    Seshu
    Edited by: its urgent on Dec 25, 2011 9:31 PM

    Hi ,
    1.)You must have to create a EO based on custom table and then VO based on this EO eventually to save the values in DB
    2.) the row.setNewRowState(Row.STATUS_INITIALIZED); is used to set the the status of row as inialized ,this is must required.
    3.) When u will create the VO based on EO the viewattributes will be created in VO which will be assigned to the fields to take care the db handling .
    You must go thtough the lab excercise shipped with you Jdeveloper ,there is a example of Create Employee page ,that will solve your number of doubts.
    Thanks
    Pratap

  • How to insert data in database table

    Hi experts,
                   How to insert data into database table using internal table from function module.

    Hi,
    As per my understanding are you looking for the complete API feature of data insertion into the database using the Locking Mechanism? If yes, then you need to create a Lock Object using the Primary keys of the Primary Table and Secondary Tables. You need to call the lock object first and then you need to make the entry into the table. This principle is based on  'All or None Concept'.
    For the insert Statement Key word you can have a look at the following link:
    http://help.sap.com/abapdocu/en/ABAPINSERT_SOURCE.htm
    Hope this helps.
    Thanks,
    Samantak.

  • How to retrive data  from  database views or projection views

    how to retrive data  from  database views or projection views

    Hi chintam,
    1. Very simple
    2. Just like normal select statement.
    3. Select * from VIEWNAME.
    4. (Instead of the tablename, we just have to give the viewname)
    regards,
    amit m.

  • How to populate data in MPP through F4 search help(the field should get filtered as per key)

    Dear Experts.
    I am new to ABAP and hence trying jmy hands on various ways of peforming a task.
    I have a requirement. I want to maintain a database tables through MPP :  ZLT_Auftrag (Refer Screen Shot 1: Doubt MPP1) and ZLT_Kunde (Refer Screen Shot2: Doubt MPP2)
    The fields of ZLT_Kunde are: K1, K2, K3
    The fields of ZLT_Auftrag are: A1, A2, A3, A4, P1 P2 and P3 are related as per the key field "A3"   (Here A3 = K2)
    I want the User to be able to Maintain this table through the Screen that I had created using MPP. (Plz refer the attached Screen Shot3:Doubt MPP3  of the SCREEN in MPP)
    When I populate the Kunde name(K1) in the SCREEN (Can be done by F4 Search help), then on hitting the pushbutton "Get Kunde" the  kunde Code (K2) appears . Now from here it can be deleted or even a new Kunde name and code can be saved dirctly to the database table : ZLT_Kunde. (Refer Screen Shoot4: Doubt MPP4)
    For Example for Kunde (K1)= BASF, Kunde Code (K2) = BSF, the Auftrag should be all those values from ZLT_Auftrag (where A3 = BSF)
    When I try to populate the Auftrag value on the SCREEN then on hitting F4 (already created for table ZLT_Auftrag in se11) then I get all the values of Auftrag (A1) from the table ZLT_Auftrag. (Ply refer Screen Shot 5: Doubt MPP5)
    MY REQUIREMENT: Here I want that either through F4 help or through drop down ONLY those values of Auftrag-A1 should appear on the SCREEN which satisfies the condition: A3 = K2
    I am unbale to get how to do that.
    I need your valuable suggstions.
    Regards
    Chandan

    And the  code of the MPP is:
    *& Module Pool       SAPMZDEMO_MPOOL_03
    PROGRAM  SAPMZDEMO_MPOOL_03.
    TABLES:  ZLT_MITA, ZLT_Kunde, ZLT_Auftrag, Zlt_Stdsatz.
    DATA: flg_lock  TYPE c,
    *      indx  TYPE i,
    *      indxk TYPE i,
    *      indxa TYPE i,
    *      TCNT TYPE sy-tabix,
          lv_msgv1  TYPE  sy-msgv1.
    *DATA: it_mita    TYPE TABLE OF ZLT_mita,
    *      it_kunde   TYPE TABLE OF ZLT_KUNDE,
    *      it_auftrag TYPE TABLE OF ZLT_AUFTRAG.
    *&      Module  STATUS_9000  OUTPUT
    *       text
    module STATUS_9000 output.
      SET PF-STATUS 'ZSTATUS01'.
    *  SET TITLEBAR 'xxx'.
      If flg_lock is Not initial.
        LOOP at Screen.
      If screen-group1 = 'G1'.
      Screen-input = 0.
      MODIFY SCREEN.
           Endif.
        ENDLOOP.
          MESSAGE s000(8i) WITH 'Mitarbeiter already locked by user' lv_msgv1.
      ENDIF.
    endmodule.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9000  INPUT
    *       text
    module USER_COMMAND_9000 input.
    *To Populate Data into Mitarbeiter through Pushbuttons
      CASE sy-ucomm.
        When 'OK_GET'.
          Clear : flg_lock.
            IF ZLT_MITA-M1 is NOT INITIAL.
                SELECT SINGLE *
                FROM  ZLT_MITA
                Where M1 = ZLT_MITA-M1.
    *To create a Lock Object so that when two or more employees are accessing the same data
    * at the same time then for the new user the data gets locked and only can been seen in
    *display mode
            IF sy-subrc = 0.
            CALL FUNCTION 'ENQUEUE_EZLT_MITALOCK'
             EXPORTING
               MODE_ZLT_MITA        = 'E'
               MANDT                = SY-MANDT
               M1                   = ZLT_MITA-M1
    *           X_M1                 = ' '
    *           _SCOPE               = '2'
    *           _WAIT                = ' '
    *           _COLLECT             = ' '
             EXCEPTIONS
               FOREIGN_LOCK         = 1
               SYSTEM_FAILURE       = 2
               OTHERS               = 3
            IF sy-subrc <> 0.
              flg_lock = 'X'.
              lv_msgv1 = sy-msgv1.
            ENDIF.
            ENDIF.
            ELSE.
                MESSAGE S000(8i) With 'Enter Mitarbeiter Name'.
            ENDIF.
        When 'OK_SAVE'.
           Modify ZLT_MITA.
           IF sy-subrc = 0.
             MESSAGE s000(8i) With 'Data Saved'.
           ENDIF.
        When 'OK_DELETE'.
            IF ZLT_MITA-M1 is NOT INITIAL.
                DELETE
                FROM  ZLT_MITA
                Where M1 = ZLT_MITA-M1.
              IF sy-subrc = 0.
                MESSAGE S000(8i) With 'Data deleted'.
              ENDIF.
            ENDIF.
    *     When 'OK_FIRST'.
    *           indx = 1.
    *     When 'OK_NEXT'.
    *           indx = indx + 1.
    *     When 'OK_PREV'.
    *           indx = indx - 1.
    *     When 'OK_LAST'.
    *           Describe Table it_mita lines indx.
    *To Populate Data into Kunde through Pushbuttons
        When 'OK_GETK'.
            IF ZLT_Kunde-K1 is NOT INITIAL.
                SELECT SINGLE *
                FROM  ZLT_Kunde
                Where K1 = ZLT_KUNDE-K1.
            ELSE.
                MESSAGE S000(8i) With 'Enter Kunde Name'.
            ENDIF.
        When 'OK_SAVEK'.
           Modify ZLT_Kunde.
           IF sy-subrc = 0.
             MESSAGE s000(8i) With 'Data Saved'.
           ENDIF.
        When 'OK_DELETEK'.
            IF ZLT_KUNDE-K1 is NOT INITIAL.
                DELETE
                FROM  ZLT_KUNDE
                Where K1 = ZLT_KUNDE-K1.
              IF sy-subrc = 0.
                MESSAGE S000(8i) With 'Data deleted'.
              ENDIF.
            ENDIF.
    *To Populate Data into Auftrag Through Pushbuttons
        When 'OK_GETA'.
            IF ZLT_KUnde-K2 is NOT INITIAL.
                SELECT SINGLE *
                FROM  ZLT_Auftrag
                Where A3 = ZLT_Kunde-K2.
            ELSE.
                MESSAGE S000(8i) With 'Enter Kunde Name'.
            ENDIF.
        When 'OK_SAVEA'.
           Modify ZLT_Auftrag.
           IF sy-subrc = 0.
             MESSAGE s000(8i) With 'Data Saved'.
           ENDIF.
        When 'OK_DELETEA'.
            IF ZLT_Auftrag-A1 is NOT INITIAL.
                DELETE
                FROM  ZLT_Auftrag
                Where A1 = ZLT_Auftrag-A1.
              IF sy-subrc = 0.
                MESSAGE S000(8i) With 'Data deleted'.
              ENDIF.
            ENDIF.
    *To Populate Data into Position Thorugh Pushbuttons
        When 'OK_GETP'.
            IF ZLT_Auftrag-A2 is NOT INITIAL.
                SELECT SINGLE *
                FROM  ZLT_Auftrag
                Where A3 = ZLT_Kunde-K2.
            ELSE.
                MESSAGE S000(8i) With 'Enter Kunde Name'.
            ENDIF.
        When 'OK_SAVEP'.
           Modify ZLT_Auftrag.
           IF sy-subrc = 0.
             MESSAGE s000(8i) With 'Data Saved'.
           ENDIF.
        When 'OK_DELETEP'.
            IF ZLT_Auftrag-A1 is NOT INITIAL.
                DELETE
                FROM  ZLT_Auftrag
                Where A1 = ZLT_Auftrag-A1.
              IF sy-subrc = 0.
                MESSAGE S000(8i) With 'Data deleted'.
              ENDIF.
            ENDIF.
        When 'OK_EXIT'.
           Leave Program.
        When 'OK_CLEAR'.
          Clear : ZLT_MITA, ZLT_KUNDE, ZLT_AUFTRAG.
    *              it_mita, it_kunde, it_auftrag,
          CALL FUNCTION 'DEQUEUE_EZLT_MITALOCK'
           EXPORTING
             MODE_ZLT_MITA       = 'E'
             MANDT               = SY-MANDT
             M1                  =  ZLT_MITA-M1
    *         X_M1                = ' '
    *         _SCOPE              = '3'
    *         _SYNCHRON           = ' '
    *         _COLLECT            = ' '
    ENDCASE.
    endmodule.                 " USER_COMMAND_9000  INPUT
    *&      Module  user_cmd_9000  INPUT
    *       text
    module user_cmd_9000 input.
      If sy-ucomm = 'OK_CANCEL'.
      LEAVE PROGRAM.
      ENDIF.
      IF sy-ucomm = 'OK_EXIT'.
          LEAVE PROGRAM.
      ENDIF.
    endmodule.                 " user_cmd_9000  INPUT

  • How to store data into database by reading sql statements from text file

    how to write java program for storing data into database by reading sql statements from text file

    Step 1: Create a property file to add various queries.
    Step 2: Read the properties file using ResourceBundle
    Step 3: Use the jdbc to execute the query read from the property file.
    So in future if you need to change query no need do any modifications in java program. But depends on how you use the property file.

  • How to display data from Database individually??? Anyone can help ?

    HI,
    i i had select a row of data from database using ,
    /* Query * From Table RESOURCEORDER where po = selected no and project = selected project */
         public ResultSet getAllData() throws SQLException
         getConnection();
         Statement stmt = conn.createStatement();
         ResultSet rs = stmt.executeQuery("SELECT * FROM RESOURCEORDER WHERE PROJECT = '" + getSelProject() + "' and PURCHASEORDERNO = '" + getPo() + "'" );
         return rs;
    After that , how do i display the data individually ?
    Eg select data is ('projectA','7891203-1', '10-4-2005','lcd',2000,'121-45217-8','electrical','pending','donwong')
    i want to display them individually, like this in a page
    Projectname: /* should display the Project A*/
    P.O no:
    Date:
    Order:
    Cost:
    Acc no:
    Type:
    status:
    Orderedby:
    Can anyone help ? cos i'm new to JSP ......Thanks alot!!!!!
    Regards,
    khim

    I assume PO being a unique key, will always return 1 row from db.
    public String[] getAllData() throws Exception
    getConnection();
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM RESOURCEORDER WHERE PROJECT = '" + getSelProject() + "' and PURCHASEORDERNO = '" + getPo() + "'" );
    String [] returnValue = new String[9];
    while(rs.next())
    returnValue[1] = rs.getString("colname");
    returnValue[2] = rs.getString("colname");
    ///and so on
    return returnValue;
    }Once you get that you could individually view it by setting a loop to run through the returned array.
    Hope it helps

  • How to search data in database which is in mixedcase

    Hi,
    I have to fetch data from database based on parameter value. The data stored in database is in mixed case. but while passing the  parameter its converting it into uppercase. so the database search fails.
    E.g Suppose the name in database is 'SANdeep'. On running the program when i pass the value as 'SANdeep' its converting it into "SANDEEP' and searches in the database. But my requirement is it should search as i entered i.e. 'SANdeep' because the data stored in the database is 'SANdeep'.
    How to do it.

    Hi sandeeo,
    declare your parameter with Lower case addtion.
    parameters p_name like ztab-name lower case.
    This way, the system will not convert the parameter into upper case.
    Regards,
    Ravi

  • How to Insert Hastables Into Database Through JDBC

    hi all,
    I have place the Data from the Hashtables Into the Database.I can place it by Iterating through the Hastables.I would Like to Place the Entire Hashtable Itself Into the Database.
    Can Any one tell me how?
    bye.

    Hi,
    Can anyone help me out how to insert image into
    database using struts...with dao n dto classes?If it matters whether or not you are using struts then you might have something wrong.
    Make sure you separate the database logic out.
    I know these types of questions are asked frequently, you might want to search the forum for additional examples.
    Here is a good one:
    http://forum.java.sun.com/thread.jspa?threadID=620455&messageID=3495899

  • Clearing data on Database through MAXL script

    Hi all,
    How can i clear data on the database through maxl script.
    I have to clear database based on some conditions like
    dimension 1 : all levels
    dimension 2 : level 3 only
    dimension 3 : level 4 like so.
    Please can any one suggest .

    You can clear data on database using maxl. BUT you can do this only if you want to clear all data from data base.
    "alter database <dbs-name> reset" is the maxl command to clear data from database.
    If you want to clear data at the dimmensional level you will have to use calculation commands.
    More information on this can be find here
    Edited by: Nra601 on May 4, 2009 10:10 AM

  • How to download Data from Database directly into excel

    I have a requirement to download very large quantity of data from database into Excel file.
    But condition is excel file should have only 65,536 rows in a single spread sheet(that's the limit i suppose),if i have more data points(rows) than it should be stored into different spreadsheet.......this continues so there can be many spread sheets in a single excel file.
    Data size can be 1 GB or more.
    Also specific naming conventions need to be followed for giving name to excel as well as different spread sheets in it.
    Please see if someone could help me out.

    Thanks for ur reply,
    But my requirement is to call "download to excel" method,in a java program on click by user for downloading an excel sheet on his machine.
    This is be done as part of a web application which is to be made (so can't open the excel first)

  • How to fetch data from database in javafx 2.2 table which is editable.

    Dears!
    I want to fetch data from database in javafx 2.2 tableformat with jdbc , which is also editable and i can add more records in this table also.
    Can anybody help me

    I can vaguely recall some sort of JavaFX database connectivity feature, I'm not sure if it's valid anymore.The link is based on JavaFX Composer which only applied to NetBeans 6.9 and JavaFX 1.x (both of which are now dead techs).
    There is a good chance you will have to write your own. There are several blogs describing other peoples' work. You could probably use them as a reference.Here is Narayan's basic [url http://blog.ngopal.com.np/2011/10/19/dyanmic-tableview-data-from-database/] tutorial for displaying data from a database in a TableView, you'll need to look elsewhere for the editing portion.
    The [url http://docs.oracle.com/javafx/2/ui_controls/table-view.htm]JavaFX TableView tutorial gives info about how to handle edits in a TableView, but you will need to tie the updates back to the database yourself.
    It is possible that [url http://www.javafxdata.org/]DataFX may provide some facilities to help support you.

  • How to extract data from database to XSLT?

    I want to generate a report by XSLT, but the data is extracted from the database. I will use Access/SQL server for my database. Can i write SQL in XSLT to extract data from database? Have any sample code or reference website to show how it work?
    THX

    for example: "SELECT code, name FROM TABLE FOR XML RAW"
    String xml = null;
    if(rs.next()){
      xml = rs.getString(1);
    }You will get xml string something like this:
    <row empID="1234"/><row empID="1235"/>
    You can construct a DOM using this xml data and operate on it.
    However you may explore more on resulting xml format.
    A different SQL Query (rather than using XML RAW) may give output in a more desired format.

  • How to retrieve data from database to the structure(complicated)

    Hello everyone:
           I want to retrieve data from database to the structure. but the structure defined like this below:
    TOLERANZOB LIKE QAMV-TOLERANZOB
    TOLERANZOB1 LIKE QAMV-TOLERANZOB
    so how can I retrieve the data from the database ? make sure that the two fields contain data both.
    Thanks in advance .
    Regards
    Nick

    Hi Nick,
    To retreive data for TOLERANZOB from QAMV,
    If you know the key fields then use
    SELECT SINGLE TOLERANZOB FROM QAMV INTO TOLERANZOB WHERE keyfields.
    else, you can use
    SELECT TOLERANZOB FROM QAMV UPTO ONE ROWS INTO TOLERANZOB WHERE....
    Once you retreive the data using the select query, you can check if it is initial and if not move the data from TOLERANZOB to TOLERANZOB1.
    <b>Reward points for helpful answers.</b>
    Best Regards,
    Ram.

Maybe you are looking for

  • How to find and install the best version of Flash Player for a G4?

    My dad has a Mac with OS 10.4.11.  It's an 800 MHz Power PC G4 with 768 MB of memory SDRAM.  His current version of Flash Player hardly works (video comes out as single images every few seconds) so we want to update it so he can watch You Tube and th

  • How to merge request and dependent task

    Hello, I would like to merge some TOs generate during the last month and I see than I have some object which are missing because they are only present in tasks. Is it possible to choose all objects contains in requests and dependant tasks when we hav

  • Existing Database Encryption ?

    I have existing db ,, how i can give the encryption to this existing db ?? After encrypted db how can i open into the sqlite tool like sqlite administration tool Lita or any othere Kindly reply  as soon as possible Amit

  • First PKGBUILD - Clisp with new-clx - please check

    # Contributor: Theomachos <info[at]pindundin[dot]de> pkgname=clisp-new-clx pkgver=2.44 pkgrel=1 pkgdesc="ANSI Common Lisp interpreter, compiler and debugger (with NEW-CLX enabled)" arch=('i686' 'x86_64') license=('GPL') url="http://clisp.cons.org/" d

  • How to move javafx stage by mouseevent drag and drop

    Hi there, Do you know how to move stage by mouse event drag and drop event. My Idea is to create a stage without title header but the user can move it by click the body of the stage and hold it and release it into some where new place by mouse event.