How do i know if row has been updated?

Hi
Please can someone guide me on how I can determine if my update has been successful. I am currently using the method below but my data is being put into the table but the method rowUpdated() returns false when it should return true.
rs.moveToInsertRow();
rs.updateString("SL_Name", "Antek")
rs.insertRow();
System.out.println("Row updated " + rs.rowUpdated());
Thanxs
Antek

I am using a primary key which is set by ms-sql server and it has the properties not-null auto incrementing. I was using the manual insert function before but then I realised the moveToInsertRow() method so I changed because of the added benefits to my program I can get. Before I was using the following code to see if a row was inserted see below. (I want something similar for the new way I insert data into table please)
======
what i use to use before
======
int numRows= myStatement.executeUpdate(sql);          
System.out.println(numRows + " rows updated");
if (numRows > 0)
returnString = "success";
Antek

Similar Messages

  • How to Know, No. of Rows has been Update, throught Triggers

    Hi all,
    I am having problem in after update trigger. I want to know How many rows has been updated by a sql statement, for that I have written on (AFTER UPDATE TRIGGER ON EMP). But it is not giving any result. I am executing Update statement from
    Sqlplus (UPDATE EMP SET SAL=23 WHERE EMPNO=7369;) We cant use Commit, and dbms_output.put_line in trigger. thats why I have used exception.
    CREATE OR REPLACE TRIGGER EMP_UPDATE AFTER UPDATE ON EMP
    DECLARE
    NO      NUMBER;
    NOROW      EXCEPTION;
    PRAGMA      EXCEPTION_INIT(NOROW, -20101);
    BEGIN
    NO:=SQL%ROWCOUNT;
    IF NO<>0 THEN
    RAISE_APPLICATION_ERROR(-20101,'Some Rows UPDATED');
    END IF;
    END;

    Hi Sachindra
    What SQL*Plus version you are using?
    Some versions that come with forms6i they dont write the number of rows updated, they just write operation 44 succeeded or something like that.
    But if you use the SQL*Plus database client (sqlplusw.exe or sqlplus.exe) which those 2 get installed with the db you will be able to see the number of rows update/deleted/inserted
    SQL> conn scott/tiger
    Connected.
    SQL> DESC EMP
    Name Null? Type
    EMPNO NOT NULL NUMBER(4)
    ENAME VARCHAR2(10)
    JOB VARCHAR2(9)
    MGR NUMBER(4)
    HIREDATE DATE
    SAL NUMBER(7,2)
    COMM NUMBER(7,2)
    DEPTNO NUMBER(2)
    SQL> UPDATE EMP SET SAL = 23 WHERE EMPNO = 7369;
    1 row updated.
    SQL>
    Hope this helps
    Regards
    Tony G.

  • How do I know what Opatch has been installed on OBIEE 11.1.1.6.2?

    Hi,
    I started working with new client and someone does obiee upgrade to 11.1.1.6.2. now users got some issue and we identified that issue can be resolved if we apply a patch and to apply that patch it is saying please make sure you have installed pre requisite patch with some number. how do I know what Opatch has been installed on OBIEE 11.1.1.6.2?
    any command or file available?
    Edited by: JV123 on Feb 14, 2013 2:48 PM

    Check this
    http://www.cool-bi.com/CMDline/DeterminingCurrentPatchLevels.php
    If helps mark

  • How do I know which block has been changed in Master/Detail

    Hi,
    I have master detail blocks. How do I know which block has been changed?
    I used :SYSTEM.FORM_STATUS. It only gave me "Changed" or "Query". but didn't tell me which block has been changed in MASTER or DETAIL.

    I believe if :system.form_status != 'QUERY' you'll need to loop through through the blocks checking :system.block_status to see who changed. Of course you'd have to go_block() before checking the status.

  • How do I know what item has been selected in a select list?

    I built a select list where the user selects one item from the list and then searches using the searchfield. I need to know what item has been selected in the select list so that I can do branching and branch the user to a particular page. Can someone tell me how I can accomplish this?
    So if I want to search for Tea in the drinks category I would need to click on Drink in the select list and then type "Tea" and select search. After that I get redirected to a table called "Drinks" and there the search results will be displayed. please help!

    I tried to mach expressions... I made a simple list(with redirection):
    STATIC:Yes;Y,No;N and it displays fine. I then try to do branching where exp1=exp2 Where I tried to have the label "X" for E1 and "Y" for E2 and nothing happened. I tried to use the name of the list Xlist and it failed too. I tried Request=exp1 and didnt work either. I set the source for the list as static. I am not sure what I am doing wrong. When i tried !=exp nothing happened either... perhaps the values I am using are wrong? Pleas help me out.

  • HT4623 The APP application on my iPad does not function properly - any downloads requested immediately fail and send me back to the main iPad screen.  Any suggestions on how to fix this - all software has been updated to iOS 5.1.1 and no other updates are

    The APP application on my iPad does not function properly - any downloads requested immediately fail and send me back tot he main iPad screen.  Any suggestions on to hoe to fix this?  The software has been updated to iOS 5.1.1, and no furthe updates are available.

    This is my boilerplate response when app downloads are stalled or in the "waiting" mode. There are a bunch of things here to try.
    Tap on the "installing" icon and see if you can pause the install, then tap on it again in order to resume the install.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    Make sure that you do not have a stalled download in iTunes - a song or podcast .... if you have a download in there that did not finish, complete that one first. Only one thing can download and install at a time on the iPad so that could be what is causing the problem.
    If that doesn't work - sign out of your account, restart the iPad and then sign in again.
    Settings>iTunes & App Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>iTunes & App Store>Sign in and see if the install resumes.
    If all else fails, download the updates or the apps in iTunes on your computer and then sync the content to your iPad.

  • HT1212 how will i know when ipad has been restored?

    I am trying to restore my ipad.  Itunes has finished downloading the update.  how will i know when the ipad has been restored?

    It has given me an error 3194 - this device is not eligible for the requested build.  What now?

  • How do I know a user has been logged out from another screen

    If one user is already logged in to the web application and another user with the same user name and password trying to log in to the same web application, i need to logout the first screen's user session. In other word, I want to disable first screen access right since it has been logged out.
    I have a user log class to record users login activities. A new user log object will be created for every login.
    How should I do that?

    Try to write an implementation of HttpSessionListener and HttpSessionAttributeListener something like the one down below and configure it accordingly.Believe tht should very well cater your requirment.
    public SessionAttributeListener implements HttpSessionAttributeListener,HttpSessionListner{
       List<HttpSession> sessionsList;
        public SessionAttributeListener(){
             this.sessionsList = new ArrayList<HttpSession>();   
        public void sessionCreated(HttpSessionEvent se){
        public void sessionDestroyed(HttpSessionEvent se) {
                this.sessionList.remove(se.getSession());
        public void attributeAdded(HttpSessionBindingEvent se){
                    if(se.getName().equals("userInfo"))
                         this.appAction(se);
        public void attributeRemoved(HttpSessionBindingEvent se){
                  if(se.getName().equals("userInfo"))
                            this.sessionsList.remove(se.getSession());  
        public void attributeReplaced(HttpSessionBindingEvent se) {
        private void appAction(HttpSessionBindingEvent se){
                    UserBean ub = (UserBean)se.getValue();
                     for(HttpSession session:this.sessionsList) {
                             UserBean ub1 = (UserBean)session.getAttribute("userInfo"); 
                             if(ub1.getUserName().equals(ub.getUserName())){
                                    try{
                                       session.removeAttribute("userInfo");
                                       session.invalidate();
                                   }catch(Exception exp){}
                    this.sessionsList.add(se.getSession());
    }Hope this might give you a brief idea of how to go about. :)
    REGARDS,
    RaHuL

  • JRadioButtons - how do i know which one has been clicked?!

    hey all,
    im working on a simple gui to implement a ticket office system. im a bit of a newbie to using GUIs and im fed up of trawling through the api's in search of answers and im on the home run... so here's my q...
    i have a gui class for doing a search for tickets. i have a controller in a seperate actionListener class for this gui. i have three radio buttons for searching for three different things and then there's a search jbutton to start the search.
    how do i know what radio button the user has selected when they click search? i need to be able to know this from the controller, not in the gui itself.
    thanks a mil!

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TicketOffice_Demo extends JFrame {
        public TicketOffice_Demo() {
            initComponents();
        private void initComponents() {
            ticketsGroup = new ButtonGroup();
            toolbar = new JToolBar();
            startSearch = new JButton();
            typeA = new JRadioButton();
            typeB = new JRadioButton();
            typeC = new JRadioButton();
            scrollpane = new JScrollPane();
            textarea = new JTextArea();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setTitle("Ticket Office Demo");
            toolbar.setFloatable(false);
            startSearch.setText("Start Search");
            startSearch.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    startSearchActionPerformed(evt);
            toolbar.add(startSearch);
            ticketsGroup.add(typeA);
            typeA.setSelected(true);
            typeA.setText("\"A\" Tickets");
            typeA.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeA);
            ticketsGroup.add(typeB);
            typeB.setText("\"B\" Tickets");
            typeB.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeB);
            ticketsGroup.add(typeC);
            typeC.setText("\"C\" Tickets");
            typeC.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeC);
            getContentPane().add(toolbar, BorderLayout.NORTH);
            textarea.setBackground(new Color(255, 255, 204));
            textarea.setEditable(false);
            scrollpane.setViewportView(textarea);
            getContentPane().add(scrollpane, BorderLayout.CENTER);
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-400)/2, (screenSize.height-300)/2, 400, 300);
        private void startSearchActionPerformed(ActionEvent evt) {
            Controller cont = new Controller(ticketType);
            textarea.append("Controller searches for ticket type '"+cont.getTicketType()+"'\n");
        private void typeAItemStateChanged(ItemEvent evt) {
            if(typeA.isSelected()){
                ticketType = "A";
            }else if(typeB.isSelected()){
                ticketType = "B";
            }else if(typeC.isSelected()){
                ticketType = "C";
        public static void main(String args[]) {
            new TicketOffice_Demo().setVisible(true);
        private JButton startSearch;
        private JRadioButton typeA;
        private JRadioButton typeB;
        private JRadioButton typeC;
        private JScrollPane scrollpane;
        private JTextArea textarea;
        private JToolBar toolbar;
        private ButtonGroup ticketsGroup;
        private String ticketType ="A";
    class Controller {
        Controller(String ticketType){
            this.ticketType = ticketType;
        public String getTicketType(){
            return ticketType;
        private String ticketType;
    }

  • How do I know my iPhone has been wiped?

    Hi, my iPhone got stolen last night so I went home immediately and logged into me.com/icloud to wipe it, but it's saying that the request has been sent but will only be wiped once connected to the Internet.
    Whoever has taken it has turned it off, but if they turn it on again they will be able to use it provided they don't connect to the Internet, right? I had disabled 3G/data roaming so it won't be instantly connected to the Internet once they turn it on. Please help!

    They will very likely just restore the iphone and use it as their own.
    Your data should be safe.

  • How do I know which workflow has been activated for my SHC in SRM

    Hi Experts ,
    Can anyone tell me where to find which workflow has been activated to my Shopping cart in the SRM. so that it creates a PO in the backend
    To create a PO in the back end it should have a WF actiavted.
    do we can have only always one WF activated or can we have multiple WFs depending on the conditions for one scenario
    Please suggest me
    Regards
    Sairam.

    Cross-Application Basic Settings u2192 SAP Business Workflow u2192 Perform Task-Specific Cusomizing
    SAP u2192 SRM u2192 SRM-EBP u2192 SRM-EBP-WFL
           -   WS10000060 (Automatic approval)
             -   WS10000129 (One-step approval)
             -   WS10000031 (Two-step approval)
             -   WS10000276 (Approval single-level over limit)
             -   WS14000044 (Completion by purchaser)
             -   WS14000109 (Approval n-step over value limit)
             -   WS14500015 (Item approval)
             -   WS14000045 (Delete shopping cart after application error)
             -   WS10000202 (Transfer purchase requisition)
             -   WS10000215 (Resubmission of shopping cart by administrator)
    You need to check Event linkage is either Activated or Deactivated aor these above work flow . I fit is activated it shows green light.
    Muthu
    Edited by: muthuraman on Jul 29, 2008 2:38 PM

  • If my iPad is lost, how do I know when it has been removed from my Apple ID account?

    I lost my son's iPad this afternoon. By the time I realized I couldn't find it and pulled out my phone to use the Find Phone My iPhone app, it may have been too late to set it up as lost. The iPad is still displaying in the app, but simply as offline. Of course, the iPad could be laying on the street somewhere, God only knows. However, if someone had reset the iPad and logged it into their own account, would it still display on my "Find My iPhone" account even if it were offline? Or, since they can reset it without being online, will it wait to refresh until they get it online? I am literally sick to my stomach, I just bought this 64 gig brand new mini two months ago for my autistic son, and he uses it daily. I cannot fathom the idea that it is not in the house, but if it were in the house, it would be connected to our Wifi automatically, and it would not be dead because I just charged it for him for our short trip today. How can I see if the seriel number is even still on my account? When I go into my account, it shows a white mini ipad, ours is black, and it does not show the same seriel number. HOWEVER, it does show that I called about the Mini on the 29th of October, so even though it is displaying as white with a randomly different seriel number, I did call about an issue on that device. Why would iTunes have a different mini seriel number set up under our account? If you cannot tell, I am freaking out. We're out $500 and I feel like there just has to be a way to get our iPad back. (Just for all of you KARMA beleivers out there: About a year and a few months ago, I was at the pool with my son and found a Kindle Fire. I immediately went through to find the owners information and contacted her to return it! There has to be good Karma for me in this situation!! ;-)  )   Please, help me determine if the iPad is still connected to my account! Anything! Thanks!

    I think you may need to book an appointment with a genius! They will fix it or replace it for you, for free!!! You can book an appointment at your local apple store at http://www.apple.com/retail
    Hope this helps
    Conchuir

  • Dynamic h:commandLinks : how do I know which one has been clicked?

    Imagine I have something like:
    <h:dataTable etc etc>
    <h:column>
    <h:outputText etc etc />
    </h:column>
    <h:column>
    <h:commandLink action="#{BeanName.removeEntry}" />
    </h:column>
    </h:dataTable>
    <h:inputText etc etc><h:commandLink action="#{BeanName.addEntry}" />
    so that when I add Entries, they get seen on the dataTable above..
    THe addEntry code is easy to do, it's only a ArrayList.add() method call but what about the removeEntry? I don't know how to figure out which 'remove' commandLink was clicked.

    If you have a datamodel in yo
    ur datatable, then you can do something like this:
    getModel().getRowData()
    This returns the selected row.
    From here it's with you.....

  • How do I know if spyware has been installed?

    Weird stuff is happening with my device.  No apps will be running and the audio recorder bar will be red and recording via autorap.  Background was changed while I showered the other morning.  Nobody in my home, was done remotely.  Battery drains quickly and if the iPad completely dies, you can only charge it on a dock, sync n charge cord will not work.  Need this crap removed.  HELP!!!!

    Hi Starlish,
    The only thing I can suggest doing is holding the power and the home button untill the iPad goes off and then trying to plug in to restore.
    Sorry if this is no good, but I really hope it helps.
    If that does not work than try this:
    Also, In General > Reset you have an option to Erase all Content and Settings.
    Message was edited by: Jpwpalfrey

  • Topic has been updated since your last login

    Is this message some kind of new improvement, or didn�t I simply notice that before? I think they should fix the current bugs before adding new features here.

    Why can't you use a base-table block? You are sure trying to do things the hard way!
    But if you insist... To make the comparison, you FIRST need to save the database value of each column in your block as you populate the block -- so you need a displayed/updateable value PLUS a hidden value of the same field. Then, to emulate Forms automatic processing, when you select and lock the row (after the user has made a change to one of the fields) you need to fetch all the values from the database again, and compare these against the hidden saved values. If any one compares not equal (and you must check for both null, also), then the row has been updated by another user.
    Good luck.

Maybe you are looking for

  • Photos imported into wrong folder

    When running an import and setting destination to import into subfolder organised by date (2011/2011-04-29) the ophotos taken late in the day do not go into the correct folder, they import into the next days folder. It appears the calculation used fo

  • Credit Memo Req. with different Pricing Procedure than Invoice

    Hi I need to create a credit memo req. from invoice reference - but both should have different pricing procedures. I have assigned different doc. pricing proc. to the new credit m. req. and maintained proper pricing proc. determination. Also in copy

  • Belle and the 3,5mm headphone connector

    With symbian Anna i had set "Headset" as default for the 3,5mm connector. After plugging in a stereo 3,5mm cable, my N8 asked me what mode i wanted (so i was able to chose from "Headphones" and "Music stand"). With Nokia Belle it always uses the defa

  • Unable to create allotted alias email accounts

    Every time I enter info & submit form for alias acct. receive alert msg. That iTunes cannot save alias at this time????

  • Need help with complex column creation command

    Hello, all I need help with a complex column creation command and SQL anywhere help is not sufficient for it. Here is the situation: I need to write a generic DDL "alter table" command, which can add/modify columns without knowing in advance if they