Help me plz, deleting in jsp

hi to all,
i created one jsp page to view the database list
<html>
<head>
<title>Delete an Project Record</title>
</head>
<%@ page language="java" import="java.sql.*"%>
<body bgcolor=LightCyan>
<h1>Delete an Project Record</h1>
<table border="1" width="400">
<tr>
<td><b>Project Id </b></td>
<td><b>Project Name </b></td>
<td><b>Client Name </b></td>
<td><b>Project Start Date </b></td>
<td><b>Estimated End Date</b></td>
<td><b>Project Manager </b></td>
<td><b>Estimated Effort </b></td>
<td><b>Delete? </b></td>
</tr>
<%
               Connection con = null;
               Statement stmt = null;
               ResultSet rs = null;
                              String driverName = "com.mysql.jdbc.Driver";
               Class.forName(driverName);
               String serverName = "192.168.10.5";
               String mydatabase = "Trainees";
String url = "jdbc:mysql://" + serverName +  "/" + mydatabase; // a JDBC url
               String username = "josep";
               String password = "josep";          con = DriverManager.getConnection(url, username, password);
               stmt=con.createStatement();
          rs=stmt.executeQuery("select * from project");
                                            if(rs != null)               
               while (rs.next())
          String Project_id  = rs.getString ("proj_id");
          String Project_name=rs.getString ("proj_name");
                 String client_name=rs.getString ("client_name");
     String start_date=rs.getString("strt_date");
     String estimated_date=rs.getString("est_date");
          String Project_mgr=rs.getString ("proj_mgr");
               int est_effort=rs.getInt ("est_effort");
%>
<tr>
     <td><%=Project_id %></td>
     <td><%=Project_name %></td>
     <td><%=client_name %></td>
     <td><%=start_date %></td>
     <td><%=estimated_date %></td>
     <td><%=Project_mgr %></td>
     <td><%=est_effort %></td>
<td><a href='delproc.jsp?Project_id=<%=Project_id %>'>delete</a></td>
</tr>
<%
                 stmt.close();
                     con.close();
%>
</table>
</body>
</html>
the result of this page was this
Delete an Project Record
Project Id Project Name Client Name Project Start Date Estimated End Date Project Manager Estimated Effort Delete?
p001 enet tratum 2006-02-20 2006-04-20 raghunath 80 delete
p002 tenet tratums 2006-03-20 2006-05-20 raghu 40 delete
then i created another jsp page to see the result of the deletion
<html>
<head>
<title>Delete Project Processing</title>
</head>
<%@ page language="java" import="java.sql.*"%>
<body bgcolor=LightGreen>
<%
                          String driverName = "com.mysql.jdbc.Driver";
                          Class.forName(driverName);
               String Project_id=request.getParameter("proj_id");                    
               String serverName = "192.168.10.5";
               String mydatabase = "Trainees";
               String url = "jdbc:mysql://" + serverName +  "/" + mydatabase; // a JDBC url
               String username = "josep";
               String password = "josep";
               Connection con = DriverManager.getConnection(url, username, password);
                                          Statement stmt=con.createStatement();
     int rowsAffected = stmt.executeUpdate("delete from project where proj_name="+Project_id);
     if(rowsAffected == 1)
%>
     <h1> Successful Deletion </h1>
<%
     else
%>
     <h1> Sorry, Deletion has failed </h1>
<%
     stmt.close();
     con.close();
%>
</body>
</html>
but here i am getting result as sorry deletion has failed
wat should the problem in deleting the database i cant able to found
if anyone knows plz reply

hai to all
in here my first jsp page shows wat are all in the database are seen
in my second jsp page iam getting output as DELECTION has failed
plz tel me if any one knows
ther is a problem in my second jsp page at this lines
<%
               String driverName = "com.mysql.jdbc.Driver";
               Class.forName(driverName);
               String Project_id = request.getParameter("proj_id");          
     String serverName = "192.168.10.5";
               String mydatabase = "Trainees";
               String url = "jdbc:mysql://" + serverName + "/" + mydatabase; // a JDBC url
               String username = "josep";
               String password = "josep";
               Connection con = DriverManager.getConnection(url, username, password);
Statement stmt=con.createStatement();
               int rowsAffected=stmt.executeUpdate("delete from project where proj_id= "+Project_id);     
               if(rowsAffected ==1)
%>
     <h1> Successful Deletion </h1>
<%
               else
%>
     <h1> Deletion has failed </h1>
<%     
               stmt.close();
               con.close();
%>

Similar Messages

  • I found My iPhone contacts on my friends Iphone we both have 4s! But we use the same apple ID and ICloud ID! How can undo what happened? all my private stuff is now on his phone!!! help me plz!!?

    I found My iPhone contacts on my friends Iphone we both have 4s! But we use the same apple ID and ICloud ID! How can undo what happened? all my private stuff is now on his phone!!! help me plz!!?

    Of course if you are both connected to the same iCloud account you have the same contacts - what did you expect?. The contacts live on the server and are read from there by the devices; so as you've both managed to sync your contacts up to iCloud they are now inextricably mixed. You can only delete your contacts by deleting individual ones, and doing that will delete them from your phone as well.
    You can only unravel this by
    1. In the iCloud contacts page at http://icloud.com, select all the contacts, click on the cogwheel icon at bottom left and choose 'Export vCard'.
    2. Sign out of System Preferences>iCloud
    3. Create a new Apple ID and open a new iCloud account with it for your own use.
    4. Import the vCard back into the iCloud contacts page.
    5. Go to http://icloud.com and sign in with the original ID. This is now his ID. Work through the contacts individually deleting the ones you don't want him to have. When done sign out and advise him to change his password.
    6. Go to the new iCloud account and delete his contacts individually.
    Of course if you have also been syncing calendars and using the same email address there are problems with doing this.

  • Frustrating JSTL, help me plz

    I'm using Tomcat 5 and JSTL 1.1. I copied the JSTL files jstl.jar and standard.jar in Tomcat's /root/WEB-INF folder. Then I ran the following code
    <%@ page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <html>
    <body bgcolor=lightblue>
    <form   method=post  action="demo1.jsp">
    NAME <input  type=text  name="text1"><br>
    PLACE<input  type=text  name="text2"><br>
           <input type=submit>
    </form>
    NAME:<c:out value="${param.text1}"  /><br>
    PLACE:<c:out value="${param.text2}"  />
    </body>
    </html>After clicking submit, the code failed to get the value. What's wrong in it? Do I need to copy those tld's in WEB_INF or do I need to make certain change in my web.xml file? I'm working hard since yesterday, help me plz.

    You are still using the JSTL1.0 uri
    The taglib import should be:
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    (note the subtle addition of /jsp/ in there)
    See this thread for full details on setting up JSTL and Tomcat:
    http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0 rely #6

  • Help me plz.. i,ve got a apple i phone 4 and i'm the 2 owner of it and i dont have it's apple id and passward for it and 1st owner doesnt know it too so what can i do for this plz help me....

    help me plz.. i,ve got a apple i phone 4 and i'm the 2 owner of it and i dont have it's apple id and passward for it and 1st owner doesnt know it too so what can i do for this plz help me....

    Neither can we.  Only the original owner can help you, surely he/she can reset their password.

  • I have a lock rotation on my iPad 2 and it won't change from landscape and I tried to reset it but nothing and I tried from lock rotation to mute but nothing and I don't no what to do now. Can u help me plz?

    I have a lock rotation next ti my battery on my iPad 2 and it won't change from landscape and I tried to reset it but nothing and I tried from lock rotation to mute but nothing and I don't no what to do now. Can u help me plz?

    With Settings > General > Use Side Switch To set to 'Lock Rotation' have you then moved the switch on the right-hand side of the iPad above the volume control 'off' ?
    Or with the switch set to control 'notification mute' you should be able to unlock rotation via the far left of the taskbar : double-click the home button; slide from the left; and it's the icon far left; press home again to exit the taskbar. The function that isn't being controlled by the side switch is set via the taskbar instead : http://support.apple.com/kb/HT4085

  • Help! datafile deleted on oracle 9i under redhat linux

    Please help me, i delete a datafile from a test tablespace and i don't know
    how to fix it on 9i, in 8i is very documented but 9i is a real pain, here
    is the error when 'dbstart'ing the db:
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    SQL> Connected to an idle instance.
    SQL> ORACLE instance started.
    Total System Global Area 353440004 bytes
    Fixed Size 450820 bytes
    Variable Size 167772160 bytes
    Database Buffers 184549376 bytes
    Redo Buffers 667648 bytes
    Database mounted.
    ORA-01157: cannot identify/lock data file 28 - see DBWR trace file
    ORA-01110: data file 28: '/oradata/alumnos/tablespaces/test2.dbf'
    Thank you in advance,
    Otto Solares

    Can you perform a Tablespace Point In Time Recovery on the specific tablespace?

  • HT204003 Since I downloaded version 1.06 my app store is not working anymore !?? Can u help me plz?

    Since I downloaded version 1.06 my app store is not working anymore !?? Can u help me plz?

    just reset your iphone and then re update it from itunes. then things should work smoothly

  • My ipad is freez...it only show a home screen. but i can turn off my ipad but not shut down...and i went to my computer and i go to itune. i try to restart my ipad but it say turn off your.find my iphone..but i cant my ipad is freezing.can help me plz.

    my ipad is freez...it only show a fome screen. but i can turn off my ipad but not shut down...and i went to my computer and i go to itune. i try to restart my ipad but it say turn off your.find my iphone..but i cant my ipad is freezing.can help me plz.

    Have you tried to reset it? Hold down the sleep and home keys for about 20 seconds and see if you can get it to reboot.

  • My ipad is freez...it only show a fome screen. but i can turn off my ipad but not shut down...and i went to my computer and i go to itune. i try to restart my ipad but it say turn off your.find my iphone..but i cant my ipad is freezing.can help me plz.

    my ipad is freez...it only show a fome screen. but i can turn off my ipad but not shut down...and i went to my computer and i go to itune. i try to restart my ipad but it say turn off your.find my iphone..but i cant my ipad is freezing.can help me plz.plz help me.................thx u

    Option 1
    Try force iPad into Recovery Mode. Follow step 1 to 6 very closely.
    http://support.apple.com/kb/HT1808
    Note: You need to be patient and repeat the above many times to recover your iPad

  • HT201285 can anyone help me recover deleted messages i deleted and saw through the Spotlight feature?

    I need help recovering my deleted text messages and coversations. I want to see the dates and all the info with them. can anyone help??

    Hello Brent208,
    It sounds like you want to restore messages that have been deleted. If you have an iCloud backup you may be able to restore from a previous date that has the data you want to restore. Keep in mind that this will restore your entire device to the way it was on that date, and any new photos, videos, or app data that has been saved since then will be erased.
    Before proceeding, be sure to back up your data to either iCloud or iTunes first:
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    Then use the following article to restore from your iCloud backup.
    iCloud: Restore your iOS device from iCloud
    https://support.apple.com/kb/ph12521
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • Regarding drop down list,  any body help me plz.. very very urgent

    i have to create a drop down list and in that if i select a value it should go to select query and display hte result in the output
    for example if i select open in the inout list. that should go to a partiucular query which i write and after that when i process the report that option open should be displayed in the output
    any body help me plz.. very very urgent

    Check  code below..
    TYPE-POOLS:  vrm.
    CONSTANTS: c_pgp_cmd(20) TYPE c VALUE '/opt/pgp/bin/pgp'.
    DATA : droplist TYPE vrm_values,
           dropval LIKE LINE OF droplist,
           w_command(2000) TYPE c VALUE '/usr/local/bin/ssh'.
    DATA:  BEGIN OF t_cmdres OCCURS 0,
             line(500),
           END OF t_cmdres.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-005.
    PARAMETERS:  tar_sys(10) TYPE c AS LISTBOX VISIBLE LENGTH 20 LOWER CASE,
                 filepath TYPE esefilepath,
                 pgpkey(1000) TYPE c LOWER CASE,
                 option(25) TYPE c AS LISTBOX VISIBLE LENGTH 15 LOWER CASE,
                 pass(100) TYPE c.
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
      PERFORM set_screen.
    AT SELECTION-SCREEN OUTPUT.
      IF option EQ 'encrypt'(000).
        LOOP AT SCREEN.
          IF screen-name = 'PASS'.
            screen-input = 0.
            MODIFY SCREEN.
            EXIT.
          ENDIF.
        ENDLOOP.
      ELSEIF option EQ 'set-preferred-ciphers'(001).
        LOOP AT SCREEN.
          IF screen-name = 'FILEPATH'.
            screen-input = 0.
            MODIFY SCREEN.
            EXIT.
          ENDIF.
        ENDLOOP.
      ENDIF.
    START-OF-SELECTION.
    write:/ 'Done'
    *&      Form  set_screen
    FORM set_screen .
      dropval-key = 'oapg18dv'(002).
      dropval-text = 'oapg18dv : DEV'.
      APPEND dropval TO droplist.
      dropval-key = 'oapg18te'(003).
      dropval-text = 'oapg18te : TEST'.
      APPEND dropval TO droplist.
      dropval-key = 'oapg18pr'(004).
      dropval-text = 'oapg18pr : PRD'.
      APPEND dropval TO droplist.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = 'TAR_SYS'
          values          = droplist
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
      CLEAR:  dropval,
              droplist[].
      dropval-key = 'encrypt'(000).
      dropval-text = 'Encrypt'.
      APPEND dropval TO droplist.
      dropval-key = 'set-preferred-ciphers'(001).
      dropval-text = 'Set cipher'.
      APPEND dropval TO droplist.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = 'OPTION'
          values          = droplist
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
      CLEAR:  dropval,
              droplist[].
    ENDFORM.                    " set_screen
    Reward if useful
    Function Module <b>VRM_SET_VALUES</b> is used to set values for droplsit..
    and be careful about Text Elements in this report.
    Regards
    Prax

  • Need Help ASAP. Deleting Underline in Adobe Reader Touch.

    I don't understand why it won't let me delete the strikeout or underline in my Adobe Reader Touch. There is no clear option when I highlight it and write click and the "Ctrl-delete" option is not working either. I need to get rid of both of these. Did them by mistake....simple task but so frustrated that I have spent 30+ minutes trying to figure this out. Please help.

    thank you
    ส่งจาก จดหมายของ Windows
    จาก: ambersenos
    ส่งเมื่อ: อา. 11 มกราคม 2558 21:23
    ถึง: thang dinhvan
    Need Help ASAP. Deleting Underline in Adobe Reader Touch.
    created by ambersenos in Adobe Reader Touch for Windows 8 - View the full discussion 
    I don't understand why it won't let me delete the strikeout or underline in my Adobe Reader Touch. There is no clear option when I highlight it and write click and the "Ctrl-delete" option is not working either. I need to get rid of both of these. Did them by mistake....simple task but so frustrated that I have spent 30+ minutes trying to figure this out. Please help.
    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7085957#7085957 and clicking ‘Correct’ below the answer
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7085957#7085957
    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
    Start a new discussion in Adobe Reader Touch for Windows 8 by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • I downloaded some you tube vedios.They were not open but remain in the dwlhelper folder. I tried to delete them but could not. help me to delete them.

    I tried to delete them but could not. Help me to delete those files which were not open.

    hello ameen, try to restart your computer and delete the files immediately afterwards. alternatively you might use a tool like [http://www.emptyloop.com/unlocker/ unlocker] to remove the lock and delete the files...

  • Servlet group is fine, but why delete the JSP group?

    Dear WebLogic support,
              You took one step forward, and one step backwards.
              Creating the servlet newgroup was the right thing to do.
              BUT DELETEING THE 'JSP' GROUP WAS NOT!
              JSP has it's own issues, which does deserve it's own group.
              Pure Servlet programmers who are not using JSP may not care to see my JSP
              posts.
              I may not care to see their posts.
              And if I feel like reading what's going on in the "pure Servlet" group, I
              can always CHOOSE TO read the stuff there. Some issues may need to be posted
              to both the groups, which happens.
              CHOICE, my friends, is always a good thing:~)
              Now I'm forced to use this group.
              Please give me back my JSP newsgroup!
              Waaaahhh!!! Boo-hooo!
              Regards,
              Murali Krishna Devarakonda
              

    Seconded. I would like the people using abomination known as "JSP" have their
              own newsgroup, so I dont have to wade through posts that have nothing to do with
              servlets.
              A.P.
              Murali Krishna Devarakonda wrote:
              > Dear WebLogic support,
              >
              > You took one step forward, and one step backwards.
              >
              >
              

  • Hi i have a problem when i want to buy gem for clash of clans can u help me plz?

    Hi i have a problem when i want to buy gem for clash of clans can u help me plz?

    What happens when you try to buy them ?
    If you are getting a message to contact iTunes support then you can do so via this page and ask them why the message is appearing (these are user-to-user forums, we won't know why) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page
    If it's a different problem ... ?

Maybe you are looking for

  • I am looking to buy this Nike+ thing but first a few questions

    I dont want to spend alot of money on Nike+ shoes so wiill it be ok if I just tie it around the top of my shoe? I hear the iPod touch does not need a receiver, How does it get the info from the sensor and do you need a app and if so where? Thanks guy

  • Cover Flow won't show JPG preview, only generic JPG icon

    Hello, For some reasons, I don't see JPGs in Cover Flow mode. I can see them in Quick Finder no problem. I tried the following and toggle the on/off the feature without success: Go to Finder, open a window, and click View>Show View Options. From ther

  • Embedding Fonts in Adobe Acrobat Distiller 6.0

    I am generating PDF's on a file server using Adobe Distiller 6.0 I need to display some text using the barcode39 font. However, when i view the completed pdf, the only place i can see the actual barcode image is on the server or a computer that has t

  • Loop Inside loop, time out error.

    Pls look into the below code, In this im looping inside a loop. Im looping thru the internal table( say 2000 records ) which has data from a select query, inside this loop  i need to calculate the total of output qty which is available in the another

  • Multiple Desktop Icons

    Have any of you seen this before? http://oz-bits.com/dl/odd-desktop.png See the multiple desktops? Seems to get duplicated when I install things sometimes. When I open a normal finder window after an install, I can see duplicate Desktop, Applications