Delete command are not executed in function of Java Bean

Hello Sir,
In Java bean have a function submitData.I want in this function run delete command through PreparedStatement..But Its not executed.
Please review..
public void submitData()
     try
System.out.println("Printed*************************************************************");
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Loading....");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@VijayKumar-PC:1521:XE","SYSTEM","SYSTEM");
System.out.println("Connection created");
PreparedStatement st=con.prepareStatement("delete  from simple where NAME='?' and BNAME='?' ");
String User=getUserName();
st.setString(1,User);
String Bname=getBookName();
st.setString(2,Bname);
int y= st.executeUpdate();
System.out.println(y);
System.out.println("Query Executed");
con.commit();
con.close();
System.out.println("Your Book are Submitted *****************");
catch(Exception e)
e.printStackTrace();
}Thanks.

Dear Sir,
I removed the singleaquotes from preparedstatement.But Its not executed in this function.Like:
public void submitData()
     try
System.out.println("Printed*************************************************************");
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Loading....");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@VijayKumar-PC:1521:XE","SYSTEM","SYSTEM");
System.out.println("Connection created");
PreparedStatement st=con.prepareStatement("delete  from simple where NAME=? and BNAME=? ");
String User=getUserName();
st.setString(1,User);
String Bname=getBookName();
st.setString(2,Bname);
int y= st.executeUpdate();
System.out.println(y);
System.out.println("Query Executed");
con.commit();
con.close();
System.out.println("Your Book are Submitted *****************");
catch(Exception e)
e.printStackTrace();
}Allthough Insert command is properly executed in another function of Java Bean.
Please review...
Thanks.

Similar Messages

  • Request parameter are not stored in database through Java Bean

    Hi,
    I want to store the request parameter in database through Java Bean.Allthough program are properly run but value are not store in DB.
    Here My code:
    Login.html:<html>
    <head>
    <title>A simple JSP application</title>
    <head>
    <body>
    <form method="get" action="submit.jsp" >
    Name: <input type="text" name="User">
    Password: <input type="password" name="Pass">
    <input type="Submit" value="Submit">
    </form>
    </body>
    </html>SimpleBean.java:
    package co;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class SimpleBean implements java.io.Serializable{
    private String User="";
    private String Pass="";
    public SimpleBean(){}
    public String getUser() {
    return User;
    public void setUser(String User) {
    this.User = User;
    public String getPass() {
    return Pass;
    public void setPass(String Pass) {
    this.Pass = Pass;
    public void show()
         try
    System.out.println("Printed*************************************************************");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Loading....");
    Connection con=DriverManager.getConnection("jdbc:odbc:Ex11dump");
    System.out.println("Connected....");
    PreparedStatement st=con.prepareStatement("insert into Table1 values(?,?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String User=getUser();
    st.setString(1,User);
    String Pass=getPass();
    st.setString(2,Pass);
    int y= st.executeUpdate();
    System.out.println(y);
    System.out.println("Query Executed");
    con.commit();
    con.close();
    System.out.println("Your logging is saved in DB *****************");
    catch(Exception e)
    e.printStackTrace();
    }submit.jsp:
    <jsp:useBean id="obj" class="co.SimpleBean"/>
    <jsp:setProperty name="obj" property="*" />
    <jsp:getProperty name="obj" property="User" /> <br>
    <jsp:getProperty name="obj" property="Pass" /> <br>
    <% obj.show();%>
    <%
    out.println("Ur data is saved in DB");
    %>Please Help me.
    Thanks.

    The issue is in the naming of your fields.
    Change User -> user and Pass->pass
    Name: <input type="text" name="user">
    Password: <input type="password" name="pass">

  • Office 2013 : Ribbon some commands are not available

    hi,
    Sometimes, in excel or others applications, we have some issues regarding ribbon : commands are not functional !
    We must close office applications to get back to a normal state.
    We did a migration from Office 2007 to Office 2013.
    best regards

    Hi,
    First, please make sure your Office program is fully patched.
    If you installed any third-part program that is integrated to Microsoft Office, please temporarily disable the integration to check the result. Also try to disable all add-ins in Office programs to check the result.
    In addition, please try to run a repair of your Office installation and then test the issue again:
    http://office.microsoft.com/en-in/project-help/repair-office-programs-HA010357402.aspx
    Hope this helps.
    Best Regards,
    Steve Fan
    TechNet Community Support

  • Delete command is not deleting all rows

    Hi All,
    Database version 10.2.0.2
    Delete command is not deleting all rows and deleting some subset of rows which it should delete, ever time I delete and do the roll back, next time it will delete some random rows, count is different everytime with in the range but not complete in anyway. see the following -
    select count(*) from test where evt_id in (select evt_id from test1);
    COUNT(*)
    27105
    delete from test where evt_id in (select evt_id from test1);
    16045 rows deleted.
    select count(*) from test where evt_id in (select evt_id from test1);
    11060
    rollback;
    Againg the same procedure -
    select count(*) from test where evt_id in (select evt_id from test1);
    COUNT(*)
    27105
    delete from test where evt_id in (select evt_id from test1);
    14320 rows deleted.
    select count(*) from test where evt_id in (select evt_id from test1);
    COUNT(*)
    12785
    why its not deleting all the 27k rows in one shot? Is there any bug related to that?
    Thanks
    Abhinav

    Odd that what looked like identical statements produced different results, both the counts and the deletes. The most likely cause of that is your data is changing - as Fahd suggested perhaps a simultaneous load taking place.
    The delete issue is probably not due to a bug. Possible but unlikely.
    If any evt_id values are NULL they won't be deleted with the subquery - a NULL in test.evt_id will never match a NULL in test1.evt_id.
    Have you tried alternative subqueries - a correlated EXISTS subquery for instance?

  • Why some Vi in LabVIEW Functions panel are not in PDA Functions panel?

    why some Vi in LabVIEW Functions panel are not in PDA Functions panel?
    such as "MT Generate System Parameters.vi".......can not run on the PDA window and say:"MT Generate System Parameters.vi":subVI is not executable. 

    mathan wrote:
    WenBin wrote:
    up
    could you please explain in bit more detail
    Looks like a lame attempt to "bump" the thread.
    Adding a (nearly) empty message places the thread back on top of the list, in the false assumption that this would generate more replies.
    Well, he's partially correct, because it added the last three posts (which of course have nothing to do with the problem at hand), but it did not increase the "real" answers.
    Bumping a thread is disruptive and generally a bad idea, because it adds a lot of noise to the forum. Imagine everybody would do it! There would be so much elbowing for the top spot that all substance would be lost in the chatter.
    In the NI forums, bumping a thread is very counterproductive, because blue contributions (from NI) will typically (and hopefully!) wait until the thread is idle for a while.
    Overall, it is a bad idea!
    LabVIEW Champion . Do more with less code and in less time .

  • 2LIS_02_ITM - Deleted items are not in the ODS 0PUR_O01

    Hello,
    We activated 2LIS_02_ITM extractor. We noticed that the deleted order items are not available in the ODS 0PUR_O01. SAP Note 578471 (Deleted positions in BW and statistics) explains that deleted items are not "statistical" relevant. However, this is an issue for us. Does anybody know if it's possible to change the behaviour of the extractor to keep deleted order items in the ODS ?
    Many thanks.
    François.

    Yes this is a known behavior in case of deltas.
    For Deleted line items Rocancel field will have an entry with R.
    To handle this you need to map ROCANCEL field in Technical group of transformation (Between Datasource to DSO) with 0Recordmode.
    Once you will do that then after activating the data in DSO it will nullify the records and deleted order or item will not appear.
    Regards,
    AL

  • I have recently updated my macs software then been onto Photo Booth and realised that all of my pictures/videos have been deleted and are not in iPhoto? Im not sure where they have all gone?

    PLEASE HELP
    I have recently updated my macs software then been onto Photo Booth and realised that all of my pictures/videos have been deleted and are not in iPhoto? Im not sure where they have all gone?

    Photobooth and iPhoto are two quite different apps with no connection between them. I'd try the Using Mac OS X forum for whatever version of the OS you have.

  • Delete command does not work

    delete command does not work.. it just freezes neither roll back happens.. please advice

    Always: If possible, give the exact command & output from your terminal, pefrerrable with copy & paste. We cannot see your screen and magically spot the problem.
    In general, you should also include your database version and OS, although I doubt that this is relevant in this particular case.
    Kind regards
    Uwe Hesse
    http://uhesse.wordpress.com

  • A nested exception occurred. Could not execute the function

    Hi Experts,
    Post upgrade of SAP Portal from 7.0 to 7.31, and when we click any application related to visual composer it shows the below error.
    and the default trace shows
    #2.0 #2014 07 22 02:34:11:243#0-700#Error#visualComposer_NWBIKit_logger#
    #EP-PIN-PRT#tc~epbc~prtc~core#C000A7EEAF63014200000002000019B9#11738650000000004#sap.com/com.sap.visualcomposer.BIKit#visualComposer_NWBIKit_logger#C921154#36##E220BC96117411E4C8F2000000B31E1A#519cf5b0118311e48b43000000b31e1a#519cf5b0118311e48b43000000b31e1a#0#Thread[HTTP Worker [@2079636611],5,Dedicated_Application_Thread]#Plain##
    A nested exception occurredCould not execute the function
    [EXCEPTION]
    com.sapportals.connector.execution.ExecutionException: A nested exception occurred. Could not execute the function.
    at com.sapportals.connectors.SAPCFConnector.SAPConnectorException.getNewExecutionLocalizedException(SAPConnectorException.java:193)
    at com.sapportals.connectors.SAPCFConnector.execution.functions.SAPCFConnectorInteraction.execute(SAPCFConnectorInteraction.java:617)
    at com.sap.portal.guimachine.bikit.query.bw.QueryViewFlatRfc.execute(QueryViewFlatRfc.java:209)
    at com.sap.portal.guimachine.bikit.designtime.bw.BWResultsetProcessor$ExecuteHandler.execute(BWResultsetProcessor.java:399)
    Please give us your valuable inputs to solve this.
    Thanks in advace!!
    Regards,
    Preetha Balan

    Hi Colin,
    Sorry for the delay in response!!
    Yes SAP gave patch VC70RUNTIME file to apply to get rid of this error.
    Even asked us to follow the sap note
    1532050 - Disabling error messages that pop up at runtime
    Hope this helps you
    Thanks,
    Preetha Balan

  • Scripts are not executing

    Hi,
    we have scheduled scripts through crontab,but from few days these scripts are not executing,there is no problem with time entries in crontab because some of them are executing correctly,what can be possible reasons for the cronjobs to not to execute.we are using sun solaris sparc 64 bit.oracle 10.1.0.4

    I can't say without knowing what the script does. Maybe somebody changed the permissions on another directory that script needs, or maybe another file it needs is no longer available, or ???
    Just suggesting a troubleshooting step. If you can run the script in a similar setup then you can eliminate the script as a likely problem. I didn't see anything on the crontab entry that looked to be a problem.
    PS: "will the date change with the execution of cronjob or it remains the same."
    No, the date on the cron daemon will stay the same. It just wakes up once a minute to check for things to do and kicks them off, it never restarts.

  • I can not delete or compose an email on iphone 5.  The icon and delete button are not on the screen.

    I can not delete or compose an email on iphone 5.  The icon and delete button are not on the screen.

    I had the same problem.  I completely powered down the iphone and then powered it back up.  I then had the bar at the bottom of the email app that I think you are looking for.
    iPhone5, OS6

  • Why netflow commands are not available in 4506-E?

    Hi,
    we have one 4506-E Chassis , Sup7L-E , LAN Base with cat4500e-universalk.SPA.03.03.00.SG.151-1.SG.bin image
    why netflow commands are not available not available in this. someone said netflow will work only with IP base License , is that right?
    Or how to enable it 
    thanks
    Sujish 

    Hi,
    For Nwtflow, you need IP Base or Enterprise Services License.
    See table-1 in this link;
    http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst4500/release/note/OL_26675-01.pdf 
    HTH

  • DACP commands are not working on Ipv6 enabled Airplay ITune service on MAC book.

    DACP commands are not working on Ipv6 enabled Airplay ITune service on MAC book.
    As we have gone through the source code(Airplay
    Audio POSIX receiver v190.9.p6) in dnssd_clientshim.c file and in API DNSServiceGetAddrInfoResponse has provided the implementation for ipv4 only.
    The test setup to test the DACP over IPV6 is by disabling the IPV4
    from MAC book and only enabling the Ipv6 .
    We are not sure if the test procedure is correct, please clarify the same.

    Hi,
    It is because of the license. In WS-C3750X-48P-L, you have a LANBASE license whereas in WS-C3750X-24P-S you have an IPSERVICES license.
    FDR_SW#show  version 
    Cisco IOS Software, C3750E Software (C3750E-UNIVERSALK9-M), Version 12.2(55)SE5, RELEASE SOFTWARE (fc1)
    License Level: lanbase
    License Type: Permanent
    Next reload license Level: lanbase
    In a LANBASE license, ip routing and ip multicast commands are not supported.
    Hope  this helps.
    Thanks,
    Arun

  • Af:commandMenuItem action and actionListener are not executing

    Hello all!
    I use JDeveloper Studio Edition Version 11.1.1.2.0. Here's the problem. I have a popup menu like this
    <af:popup id="someMenu" animate="default">
    <af:menu id="pt_m1">
    <af:forEach var="item" items="#{ContextMenuHelperBean.availableUserRoles}">
    <af:commandMenuItem text="#{item.roleName}"
    action="#{ContextMenuHelperBean.changeUserRole_Action}"
    actionListener="#{ContextMenuHelperBean.changeUserRole_ActionListener}"
    immediate="true"
    partialSubmit="false"
    id="pt_cmi1" rendered="true">
    <f:attribute name="userRole" value="#{item}"/>
    </af:commandMenuItem>
    </af:forEach>
    </af:menu>
    </af:popup>
    The problem is that action and actionListener are not executing, when the menu item is selected (but the page is reloaded with no changes). ContextMenuHelperBean has a "session" scope set in adfc-config.xml. What can be wrong with this?

    Now I've encountered a new kind of error. I create a menu in a managed bean like this:
    In JSPX
    <f:view beforePhase="#{RolesMenuSupportBean.createMenus}">
    <af:popup id="cxtMenu" animate="default">
                            <af:menu id="pt_m1"
                                     binding="#{RolesMenuSupportBean.rolesMenu}">
                            </af:menu>
                          </af:popup>In com\cs\webb2\view\utils\menu\RolesMenuSupport.java
        public void createMenus(PhaseEvent phaseEvent) {                       
            List<IUserRole> rolesList = getAvailableUserRoles();
            for (IUserRole role: rolesList) {           
                Boolean hasItem = false;           
                for (Iterator iter = rolesMenu.getChildren().iterator(); iter.hasNext(); ) {
                    RichCommandMenuItem item = (RichCommandMenuItem) iter.next();
                    if (!hasItem)
                        hasItem = item.getText().equalsIgnoreCase(role.getRoleName());
                if (!hasItem) {
                    RichCommandMenuItem newItem = new RichCommandMenuItem();                                                       
                    newItem.getAttributes().put("userRole", role);
                    newItem.setText(role.getRoleName());
                    newItem.setId(ITEM_ID);               
                    newItem.setActionExpression(getActionExpression("#{RolesMenuSupportBean.changeUserRole_Action}"));                           
                    newItem.addActionListener(getExpressionActionListener("#{RolesMenuSupportBean.changeUserRole_ActionListener}"));                               
                    rolesMenu.getChildren().add(newItem);  
        } The menu is created successfully, but when I click on any item, I get an exception
    <b>javax.servlet.ServletException: Method not found: com.cs.webb2.view.utils.menu.RolesMenuSupport@d4702.changeUserRole_Action(void)</b>
    But of course I have such a method in my com.cs.webb2.view.utils.menu.RolesMenuSupport:
    In com\cs\webb2\view\utils\menu\RolesMenuSupport.java
        public String changeUserRole_Action()
            System.out.println("Action!");
            // no code yet
            return "adfMenu_Main";
        }And there <b>is</b> a managed bean named RolesMenuSupportBean, which is associated with class com.cs.webb2.view.utils.menu.RolesMenuSupport.
    Can anyone tell me, what can be wrong?

  • Some key commands are not working

    I have a 2010 MacBook Pro running OS 10.10.2. 
    When I use cmd/shift/4, nothing happens.  However, these keys work individually.  Similarly, in Pages, hitting cmd/shift/> will zoom the content in the window, but cmd/shift/< will not zoom back out.  I've check my keyboard settings and all of the keys are mapped correctly and set to default settings.  None of them seem stuck down. 
    Does anyone have any ideas of other things I can check to restore these functions?  Thanks!

    Yes, I've done this already.  It looks just like your image. 
    I rebooted, hoping that would fix it and it did not.  Also, this started before I loaded Yosemite and I was hoping loading it might fix the problem if it was something simple like that. 
    I checked the apps tab also (I have no apps) but the only one on there was the "show help menu" button and the keys listed for it are not replacing any other commands.

Maybe you are looking for

  • HI .. PROBLEM IN SUBMITTING THE EDITED DATA FROM THE EDIT PAGE

    HI, I am having a Main form consiting of a af:table which is binded .. so when i select the row and click on "edit" button binded with the table.. i am able to get the respective data form in the Edit page. Now when i modify any data in the binded te

  • Kernel panic... I don't know how to resolve this problem

    I don't know what the heck is going on, but lately, my Macbook 10.5.8 (White) has been crashing very frequently.. and this really gets in the way of my work :/ Also, btw, my CD drive is busted, so I can't reinstall the OSX software if that's what I h

  • Please help - synthesist making videos

    I have a Sony DCR-DVD403 camcorder connected to my G4 iMac via a Canopus ADVC-100 firewire converter box. Using iMovie, I've been recording videos of myself playing keyboards "live" in my home electronic music studio and sharing them on YouTube. The

  • How can i attach a signature?

    hi i just want 2 know about if theres a posibility to attach a html signature to a pdf file

  • Buying a new Gaming pc

    I am looking for a pc that can run Battlefield 3 on ultra graphics but my budget is around $1000. There is one compter i am looking at right now.  This one : http://www.bestbuy.com/site/CyberpowerPC+-+Gamer+Xtreme+Desktop+-+8GB+Memory+-+1TB+Hard+Driv