Delete data in database

<%
Connection conn = null;
String nama = request.getParameter("nama");
String driver ="com.mysql.jdbc.Driver";
try{
Class.forName(driver);
     conn = DriverManager.getConnection("jdbc:mysql://localhost/e-jualan", "root","123");
     catch( Exception e )
          out.println (e.toString());
%>     
<%
String sql_delete = "delete from tempah where nama = '"+nama+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql_delete);
%>
what wrong with my coding? because i can't delete the data... help me please... tq....

This code doesn't belong in JSPs and the way you used the PreparedStatement is wrong.
[Check the 1st hit|http://google.com/search?q=preparedstatement+tutorial+site:sun.com]

Similar Messages

  • Deleting  data from database

    Hello sap experters
    we are running a institution  to learn sap.
    we have to delet the  students data ffrom database after completing   threir session,(before starting another batch).
    please solv this problem,

    Hi.
    Please do not ask the same question in several forums. Invest some time to find the appropriate forum for your question and then ask it there. As this question was asked in more than one forum I will lock this thread here.
    Best regards,
    Jan Stallkamp

  • Update/insert/delete data from xcelsius to Database via web service

    Hi,
    I need to create dashboard that go function can <b>update/insert/delete</b> data send to <u>Database</u> thru <u>web services</u>, as i know got 2 xcelsius add-on software which support those of function <b>InfoBurst</b> and <b>flynet </b>
    <b>InfoBurst</b>
    http://www.infosol.com/azbocug/minutes/4-Writeback%20to%20a%20Database%20with%20Xcelsius.pdf
    <b>flynet </b>
    http://www.flynetviewer.com/public/community/Blogs/FlynetXcelsiusServerUser/default.aspx
    Except this 2 purchase add-on xcelsius, any other solution ?  
    Maybe need to write some in MSSQL or C# programming which enable insert, update, delete ...etc  ?
    *note: i not use Xcelsius Engage Server , i use Xcelsius Engage only
    thanks,
    regards
    s1
    Edited by: Leong Pui Kee on Mar 1, 2011 6:06 AM

    Hi,
    As of now in Xcelsius/Dashboard Design there is no feature or functionality to insert/update/delete data from database.
    Solution:
    Create a Web service in let’s say C# or Java, which will perform insert/update/delete operation.
    In Xcelsius add Web Service connection and user above web service.
    Xcelsius Web Service connection provides option to pass input values to a Web Service (Input Pane) and get the result (Output values pane).
    We can pass values to be written to the database as a input to Web Service via Web Service connection from Xcelsius and write data to the database.
    Note:
    Performing delete operation from Xcelsius Dashboard could be risky and may delete important data from database. I would not prefer giving delete option/functionality in Xcelsius dashboard.
    Hope this helps!
    Thank you.
    Regards,
    Vinay Mhaske

  • Deleting Data Package with Abap - error in Abap statement

    Hi,
    I am trying to delete data with abap but my logic is not working and it failed with error message Error in an abap/4 statement  when processing
    requirement
    - Delete data package when plant = INDIA
    - Delete data package when Area = 01 OR Group =  J001 in customer master data table.
    Logic
    Data: T_Data TYPE DATA_PACKAGE_STRUCTURE Occurs 0 WITH HEADER LINE.
    data: lt_BI0_PCUSTOMER LIKE /BI0/PCUSTOMER OCCURS 0 WITH HEADER LINE.
    LOOP AT DATA_PACKAGE.
    MOVE-CORRESPONDING DATA_PACKAGE TO T_DATA.
    Refresh lt_BI0_PCUSTOMER.
    select * from /BI0/PCUSTOMER into TABLE lt_BI0_PCUSTOMER
    WHERE CUSTOMER = T_DATA-SOLD_TO.
    Read table lt_BI0_PCUSTOMER WITH KEY CUSTOMER = T_DATA-SOLD_TO.
    IF sy-subrc EQ 0.
    LOOP AT lt_BI0_PCUSTOMER.
    IF lt_BI0_PCUSTOMER-AREA= '01' or
    lt_BI0_PCUSTOMER-GROUP = 'J001'.
    DELETE T_DATA.
    APPEND T_DATA.
    endif.
    ENDLOOP.
    ENDIF.
    ENDLOOP.
    DATA_PACKAGE[] = T_DATA[].
    * Delete data package when Plant EQ INDIA
    DELETE DATA_PACKAGE WHERE PLANT = 'INDIA'.
    thanks
    Edited by: Bhat Vaidya on Oct 19, 2010 8:41 AM
    Edited by: Thomas Zloch on Oct 19, 2010 9:55 AM

    Hi,
    DELETE DATA_PACKAGE WHERE PLANT = 'INDIA'.
    Above syntax for delete data from internal table
    For deleting the database table write statement as follows
    DELETE From DATA_PACKAGE WHERE PLANT = 'INDIA'
    Your are missing the from keyword from statement.
    What could i have understand, if it is your solution of Query.
    Exactly you want to delete data from database table or internal table ?

  • How to update data into database from mx datagrid?

    Hello,
         I am developing a native application. I have connected my application using HttpServices i.e. remote objects to spring mvc 2.5 application. I have done inserting and deleting data from database. Now I want to update the records from datagrid itself. I am new to AIR please suggesst me something useful.
         Thanks in advance..

    Likely you're querying only one selected value from the request using HttpServletRequest#getParameter() instead of an array of selected values using HttpServletRequest#getParameterValues().

  • How to delete data before insert in oracle database

    Hi friends,
    I have one scenario.I want to send data from sap to Oracle database.Befor i am inserting data in database table,i want to clean/delete all the records in the table .This interface will run twice in a day.Can any body help me.
    SAP-PI-JDBC
    Thanks
    Ravi

    Hi Puneet,
    As per u r suggestions,i am using stored procedure.But i am getting following error.
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. MASTERXXXXXX' (structure 'Statement'): java.sql.SQLException: ERROR: Invalid XML document format for stored procedure: 'type="<SQL-type>"' attribute is missing for element 'NAME' (Setting a SQL-type (e.g. INTEGER, CHAR, DATE etc.) is mandatory !)'
    I have define below structure.Please check the structure and guide me.
    <Statement
            Action   attribute  required
            Table 
    Access  
            Empname   string
            Empid         string
            date            date
              Type     attribute   required
    EXECUTE----
    >Action
    Table----
    >MASTERXXXXXX
    Type----
    >char
    Please check the above structure andguide me to changes if any requires.
    Thanks
    Ravi

  • How to delete data from single field in a database table?

    Hi guys,
         Plz suggest me How to delete data from single field in a database table?
    thnks,
    pavan

    hi
    in addition to abv details..chk this:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3aef358411d1829f0000e829fbfe/content.htm
    http://dev.mysql.com/doc/maxdb/en/34/ee7fbd293911d3a97d00a0c9449261/content.htm
    regards,
    madhu

  • Unable to Delete Data from PSA

    Hi Experts,
    I have a process chain which delete data from PSA on weekly basis . it running good . Since one month one of data target PSA data not deleting.
    it gives me error like DDL time(___1): .........2 milliseconds
    Delete request REQU_03RM2LOJ284N3GLM7Q574WLAO from PSA 8Z0MM_O39_OA: Error - subrc: 2
    When i am tring to delete manually it gives me above error only.
    I used programme (RSAR_PSA_CLEANUP_DIRECTORY)
    for deleteting PSA Data this programme gives me errors request already deleted from data base. But still those request available when i am looking into PSA data.
    it's happen only quality system not in the Production.
    Kind Regards,
    ve.

    Hi Srinath,
    when i am looking into system there is no programeme with name(SAP_PSA_ZEROCORREC) But another programme RSAR_PSA_CLEANUP_DIRECTORY is available i tried with these programme for deleting PSA it gives me error like request deleted from database.
    But it gives me an error indicator only.
    i  am tried to delete manually by selectiong those request from PSA it gives me error DDL Time (______1) 2 milliseconds.
    Kind Regards,
    ve.

  • How can i delete data in psa and how can i partation psa?

    hi friends,
    can i delete data from psa and how can i partation psa?
    Thanking u
    suneel.

    hi Suneel,
    http://help.sap.com/saphelp_nw70/helpdata/en/7d/724d3caa70ea6fe10000000a114084/frameset.htm
    Using partitioning, you can separate the dataset of a PSA table into several smaller, physically independent, and redundancy-free units. This separation can mean improved performance when you update data from the PSA. In the <b>Implementation Guide with SAP NetWeaver  > Business Intelligence > Connections to Other Systems  > Maintain Control Parameters for Data Transfer</b> you define the number of data records needed to create a new partition. Only data records from a complete request are stored in a partition. The specified value is a threshold value.
    transaction SPRO to go implementation guide
    at database level
    http://help.sap.com/saphelp_nw70/helpdata/en/33/dc2038aa3bcd23e10000009b38f8cf/frameset.htm
    If you are using this database you can also partition PSA tables. You first have to activate this function using RSADMIN parameter DB4_PSA_PARTITIONING = 'X'. SAP Note 815186 includes more comprehensive information on this.
    hope this helps.

  • Deleting data from a table where there are no indexes on the table

    Hi
    We have one interface program for one time process.When I was testing the process it was taking too much time to load the data around 1000 records.
    it happens in 2 steps
    1 puts into stage table
    2 puts into base table
    in the process/package I have delete statement that deletes data from stage table before each process.
    Stage table did not have any indexes but the base table has(obvisiosly)
    any idea?
    please help me on this.
    Thanks,
    Y

    Hi,
    Please post the application/database details along with the OS.
    Is this interface program a seeded or custom one?
    Please enable trace on this concurrent program as per (Note: 296559.1 - FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12) and generate the TKPROF to find out why it takes that long to load/delete the data.
    Thanks,
    Hussein

  • "Transfer structure  does not exist" while deleting data from a DSO

    Hello experts,
    while deleting data from a DSO I get the following messages:
    @5B\QInformation@     Database table /BIC/AAKIVO1400 was deleted and recreated
    @5C\QError@     Transfer structure  does not exist
    When I try it twice process works without any problems. I get then the following msgs:
    @5B\QInformation@     InfoCube / DataStore object "AKIVO14" contains no data (yet)
    @5B\QInformation@     Database table /BIC/AAKIVO1400 was deleted and recreated
    So I think the first deletion works but ended with errors. What could be the reason?

    Please check if data from new and chage log table is also deleted.
    For the error message : Do you have 3.5 flow ? Check your transfer structure , if it is active and then again try to right click and delete data from DSO.
    - Monika

  • Program or Function module to delete data from Open Hub Destination Table

    Hi All,
    Can anybody suggest me a Program or Function module to delete data from Open Hub Destination Table.
    Thanks & Regards,
    Vinay Kumar

    You can simply goto t-code SE14 mention the open hub destination table and Delete data by clicking on "Activate and Adjust database" with radio button "Delete Data".
    Regards,
    Arminder

  • How to delete data from Open Hub DB table when the DTP is inactive..

    Hi Gurus,
    I am transporting some 2LIS extractors to QA with some enhancements.
    The data goes to an OHD ( third party ) pulled by a process outside SAP enabled by a BAPI.
    Now , By mistake , I imported the OHDs with still some old left in the DB table of OHD ( /bic/oh<>)
    It's not allowing to me do manual activation and also DTP is inactive ( cannot do a delta DTP and make no of records zero )
    I want to delete the data in the OHD DB tables ..any clues....
    Thanks,
    Chetan

    Hi Chetan,
    The OHD table name is usually /BIC/OH<OHD-name> .  You can find it in the OHD definition.
    Go to transaction se14, give the table name and say edit.
    Select Delete Data and say Activate and adjust database.
    This will delete the entire contents of the OHD DB table.
    Regards,
    Uma Maheswari

  • Saving data in database by using MM17

    I have customised fields in MARA table. I want to save the data in database by using Mass transaction MM17. Can any one can give the solution.

    Please do not post the same question more than once.  Please read the Terms of Engagement.  I have deleted your duplicate posts.

  • Delete rows in database table

    Hi ,
    I need to delete all the records in the dtabase table and insert new data into it.
    I use the below code , but the delete returns with sy-subrc 4 and doesnt delete the records in table ?
    delete ZZVT2_BW.
      commit work and wait.
      insert ZZVT2_BW from table itab_zvt2 accepting duplicate keys.
      commit work and wait.
    Thanks,

    Deleting from a Database Table
    <b>- DELETE FROM dbtab. or
    DELETE FROM (dbtabname).</b>
    - DELETE dbtab FROM wa. or
    DELETE (dbtabname) FROM wa.
    - DELETE dbtab FROM TABLE itab. or
    DELETE (dbtabname) FROM TABLE itab.
    - DELETE dbtab. or
    DELETE *dbtab.
    - DELETE dbtab VERSION vers. or
    DELETE *dbtab VERSION vers.
    use the bold text in u r program

Maybe you are looking for

  • WLAN Connection

    Hello, my wireless connection works, but at irregular intervals my MacBook Pro loses the connection to the WLAN. Sometimes I have to enter the WLAN identifier again. According to the Apple network analysis, everything works perfectly. Does anyone hav

  • Aiyee! Firefox keeps crashing on me.

    Firefox keeps crashing on me again and again and again. . . == Crash ID(s) == sqlite3VdbeExec == User Agent == Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.30

  • ABAP new editor

    I would like to use the new front-end editor, but in my GUI setting, can't find the new editor, I am using the SAPGUI version is 710, how can I change it. thanks!

  • Mircrosoft Visual C++ Runtime Library Runtime Error! Program:C:Programfiles\MozillaFirefox\firefox.exe abnormal program termination

    I run XP. I cant run firefox it in safe mode either. What else do you need to know?

  • Problema en instalacion del CS3

    Hola a todos, desde hace meses he tenido el mismo problema. Tengo instalado Illustrator, Photoshop CS2, DWstudio 8, Premiere Por 2.0 y por ultimo Flash CS5. Bueno el problema es que cuando la instalacion del CS3 esta en progreso, pide insertar el dis