Fail to update record in the RowUpdating event

If I have well understood, the RowUpdating event is called before to send the row to the database.
I want to modify the row argument of this event before to send it to oracle to add traceability info (user name of the user and the date of modification)
No exception is raised, but the modifications I do to the row are not saved in the database.
You will find my sample code here under.
Thanks
Benoit FRANC
Atos Origin Belgium
Sample code
First create a table with this script:
DROP TABLE TEST CASCADE CONSTRAINTS ;
CREATE TABLE TEST (
ID NUMBER (10) NOT NULL,
DATANUMBER,
STRING VARCHAR2 (50),
CONSTRAINT PK_TEST
PRIMARY KEY ( ID ) ) ;
Manually enter a row with ID = 1; DATA=1 and STRING = "A"
Imports System.Data
Imports Oracle.DataAccess.Client
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sSql As String
Dim mConnection As OracleConnection
mConnection = New OracleConnection("User Id=eperform;Password=eperform;Data Source=tractDev")
mConnection.Open()
sSql = "SELECT * FROM TEST WHERE ID = 1"
Dim oraDA As OracleDataAdapter = New OracleDataAdapter(sSql, mConnection)
Dim oraCB As OracleCommandBuilder = New OracleCommandBuilder(oraDA)
Dim oraDS As DataSet = New DataSet()
oraDA.FillSchema(oraDS, SchemaType.Source, "SourceTable")
oraDA.Fill(oraDS, "SourceTable")
oraDS.Tables(0).Rows(0).Item("STRING") = "Hello" & Now 'only to see the change in the bd
Try
AddHandler oraDA.RowUpdating, AddressOf OnRowUpdating
oraDA.Update(oraDS, "SourceTable")
Catch ex As Exception
MsgBox(ex.Message)
Debug.WriteLine(ex.Message)
Debug.WriteLine(ex.StackTrace.ToString)
End Try
mConnection.Dispose()
mConnection.Close()
End Sub
Private Sub OnRowUpdating(ByVal sender As Object, ByVal args As OracleRowUpdatingEventArgs)
Try
args.Row("DATA") = -1
Catch ex As Exception
Debug.WriteLine(ex.Message)
Debug.WriteLine(ex.StackTrace.ToString)
End Try
End Sub

benoit
I have tried working with RowUpdatingEvent, RowUpdatedEvent Handler, it
works well. I did not go through your code but I am pasting the code I had tried, updatation happens as expected. Hope that helps.
Jagriti
Pls:This code is not the complete class, I have pasted only the relevant methods.
Public Function getConnection() As OracleConnection
'Return connection reference
Return conn
End Function
'This method updates the database using dataAdapter
Public Function UpdateRecords()
Try
sbox.AppendText("Updating the database" + Environment.NewLine)
sbox.Update()
'Update the database with the help of dataAdapter update method
dataAdapter.Update(dset, "COUNTRYTAB")
sbox.Update()
Catch ex As Exception
sbox.AppendText("Error while Updating the database" + Environment.NewLine)
sbox.AppendText(ex.ToString() + Environment.NewLine)
sbox.Update()
End Try
End Function
'RowUpdating EventHandler
Private Sub OnRowUpdating(ByVal sender As Object, ByVal e As OracleRowUpdatingEventArgs)
sbox.AppendText("** OnRowUpdating() Called **" + Environment.NewLine)
sbox.Update()
End Sub
'RowUpdated EventHandler
Private Sub OnRowUpdated(ByVal sender As Object, ByVal e As OracleRowUpdatedEventArgs)
sbox.AppendText("** OnRowUpdated() Called **" + Environment.NewLine)
sbox.Update()
End Sub
'This method adds a RowUpdating event handler if it 'is not added already.
Public Function AddUpdatingHandler()
If updatingCount = 0 Then
'Add the eventHandler
AddHandler dataAdapter.RowUpdating, AddressOf OnRowUpdating
updatingCount = 1
End If
End Function
'This method adds a RowUpdated event handler if it is not added already.
Public Function AddUpdatedHandler()
If updatedCount = 0 Then
'Add the eventHandler
AddHandler dataAdapter.RowUpdated, AddressOf OnRowUpdated
updatedCount = 1
End If
End Function

Similar Messages

  • How can I update record in the block that Data Source is PROCEDURE?

    I like use Procedure as the Data Source of block.It's very flexible.
    Usually I do this only query the record,but now I must update record in the block that Data Source is Procedure.
    What next step can I do?Can anyone offer some examples?
    This is example, you goto
    http://www.2shared.com/file/1923834/e0b65fb7/Example.html
    Wait about 30 sec, Click "Save file to your PC: click here",and then you can download it.

    <p>I have written an article about some advanced Forms features.
    Have a look at the 2.3.2 paragraph</p>
    Francois

  • Go to detail page and update record at the same time

    Hi guys,
    I`m very new to dreamweaver and have no coding skills, so
    please be gentle.
    I`m have created a mail box and it all works fine, the
    problem i`m having is that I want to be able to tag wether a
    message has been read or not.
    So the subject has to be a link so when someone clicks the
    subject you are redirected to the read message page and it displays
    the message in full.
    My question is there a way to go to detail page and update
    record at the same time?
    I`m using ASP and the mysql read or not field is a SET

    "mrmidjam" <[email protected]> wrote in
    message
    news:fghrpf$7s2$[email protected]..
    > Hi guys,
    >
    > I`m very new to dreamweaver and have no coding skills,
    so please be
    > gentle.
    >
    > I`m have created a mail box and it all works fine, the
    problem i`m having
    > is
    > that I want to be able to tag wether a message has been
    read or not.
    >
    > So the subject has to be a link so when someone clicks
    the subject you are
    > redirected to the read message page and it displays the
    message in full.
    >
    > My question is there a way to go to detail page and
    update record at the
    > same
    > time?
    You can use the Update Record ZerverBehavrior and then have
    it redirect to
    the detailpage.
    Joris

  • Informatica failed to update records in target table

    Hi,
    Recently I converted hourly full load into incremental laod. everything is working good except updating records in target. Informatica not updating any records and I'm trying to understand and troubleshoot the issue. details given below
    I ran mapping debugger and came to know Filter transformation is filtering the data instead of passing to next transformation because update flag is X.
    ETL_PROC_WID AND LKP_ETL_PROC_WID are same and update flag = X.
    I dont understand why ETL_PROC_WID AND LKP_ETL_PROC_WID are same. As per my knowledge Informatica generates new ETL_PROC_WID for every ETL run. If you know anything about it please let me know.
    I executed code in SYS_COL_DIFF and UPDATE_FLG manually(on paper for few records) by assuming ETL_PROC_WID AND LKP_ETL_PROC_WID are different and got UPDATE_FLG=U
    If you know how MPLT_GET_ETL_PROC_WID mapplet in OOTB works please let me know.
    appreciate you for your help
    Thanks
    Jay.
    Edited by: JV123 on Dec 12, 2012 9:29 AM

    Welcome to the forum.
    You can try your hands on MERGE while performing the INSERT operation
    Something like this
    MERGE INTO Emp_Org eo
    USING (
              select Empno,deptno,empname,currenttimestamp from Emp
           ) x           
    ON (
                   eo.Empno      = x.Empno
    WHEN NOT MATCHED THEN
         INSERT
              Empno,
              country,
              Emporg,
              currenttimestamp,
              Targettimestamp
         VALUES
              x.Empno,
              'USA', /* Used Constant here */
              'Emporg', /* Used Constant here */
              x.currenttimestamp,          
              sysdate /* Used Constant here */
         );If you are not ok with the solution, then provide some sample data with expected output

  • Updating records in the database problem...

    hi, hello to all members, my problem is this, i can't update my records, my table name is UsrTable with a two fields only, which UsrName and Password. all i want to do is when the user wants to sign up and enters there username and password the database will be updated of the new record. i paste the sorce code in here to make it precise co'z i cant figure out how to update the database, sorry if the coding is too long and not good , im just a beginner in JAVA especially using JDBC.
    ****START CODE*****
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    public class SignIn extends JFrame
    private JPanel jInput;
    private JPanel jButton;
    private JButton Savebtn,Exitbtn;
    private JLabel userlbl,passlbl,connectionLabel;
    private JTextField Usertxt;
    private JPasswordField Passtxt;
    public static final String DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
    public static final String url = "jdbc:odbc:UserInfo";
    public static final String DATABASE = "\\User.mdb";
    private Connection connect ;
    public String tmpUser,tmpPass,query;
    public SignIn()
    super("Create your Account..");
    setResizable(false);
    ImageIcon imgIcon = new ImageIcon("c:/JavaCourseware/Images/cdicon.jpg");
    this.setIconImage(imgIcon.getImage());
    addWindowListener(new WindowAdapter()
    { // Opens addWindowListener method
    public void windowClosing(WindowEvent e)
    { // Opens windowClosing method
    int result;
    result = JOptionPane.showConfirmDialog( null,"Are you sure you want to exit?",
    "Confirmation Required...", JOptionPane.YES_NO_OPTION );
    if(result == JOptionPane.YES_OPTION)
    System.exit(0);
    else
    return;
    } // Closes windowClosing method
    }); // Closes addWindowListener method
    try
    InitComp();
    catch(Exception e)
    public void InitComp() throws Exception
    Usertxt = new JTextField(15);
    Passtxt = new JPasswordField(15);
    connectionLabel = new JLabel();
    userlbl = new JLabel("Enter your username: ");
    passlbl = new JLabel("Enter your password: ");
    Savebtn = new JButton("Save");
    Exitbtn = new JButton("Exit");
    this.setSize(new Dimension(320,150));
    this.setLocationRelativeTo(null);
    this.getContentPane().setBackground(Color.blue);
    connectionLabel.setForeground(Color.YELLOW);
    connectionLabel.setBackground(Color.BLUE);
    connectionLabel.setFont(new Font("Arial", Font.PLAIN , 12));
    buildTxtInput();
    buildBtn();
    this.getContentPane().add(connectionLabel,BorderLayout.NORTH);
    this.getContentPane().add(jInput,BorderLayout.CENTER);
    this.getContentPane().add(jButton,BorderLayout.SOUTH);
    //make a connection
    try
    //url = "jdbc:odbc:UserInfo";
    Class.forName(DRIVER);
    connect = DriverManager.getConnection(url);
    connectionLabel.setText("You have made a successful connection to: " + DATABASE);
    catch(ClassNotFoundException cnfx)
    cnfx.printStackTrace();
    connectionLabel.setText("Connection unsuccessful" + cnfx.toString());
    catch (SQLException sqlx)
    sqlx.printStackTrace();
    connectionLabel.setText("Connection unsuccessful" + sqlx.toString());
    catch (Exception ex)
    ex.printStackTrace();
    connectionLabel.setText("Connection unsuccessful" + ex.toString());
    Savebtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    try
    Statement state = connect.createStatement();
    if (Usertxt.getText().equals("") && Passtxt.getText().equals(""))
    connectionLabel.setText("Invalid Input!");
    JOptionPane.showMessageDialog( null, "Invalid Entry", "Saving Abort...", JOptionPane.INFORMATION_MESSAGE );
    state.close();
    else
    state.executeUpdate("INSERT INTO UsrTable" +
    "VALUE UsrName = '" +
    Usertxt.getText() +"' AND Password = '" +
    Passtxt.getText() +"'");
    JOptionPane.showMessageDialog(null, "Your account is already created!","Thank you...",
    JOptionPane.INFORMATION_MESSAGE);
    state.close();
    catch (SQLException sqlex)
    sqlex.printStackTrace();
    connectionLabel.setText(sqlex.toString());
    });//end of Save Listener
    public static void main(String args[])
    SignIn Signfrm = new SignIn();
    Signfrm.show();
    private void buildTxtInput()
    jInput = new JPanel();
    jInput.setLayout( new GridLayout(2, 2, 0, 10) );
    //user.setForeground(Color.yellow);
    jInput.setBorder(BorderFactory.createTitledBorder(""));
    //pass.setForeground(Color.yellow);
    jInput.add(userlbl);
    jInput.add(Usertxt);
    jInput.add(passlbl);
    jInput.add(Passtxt);
    private void buildBtn()
    jButton = new JPanel();
    jButton.setLayout( new GridLayout(1, 1, 10, 10) );
    jButton.setBorder(BorderFactory.createRaisedBevelBorder());
    jButton.add(Savebtn);
    jButton.add(Exitbtn);
    }//end of class
    ***END PROGRAM***
    im hoping there's someone can help me with this, co'z im badly need it.thanks..again,

    hi! i followed your code, but i get a different error i dont know what is the meaning of error, first heres my code i write...thanks for the fast reply co'z i badly need it.
    Savebtn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
                   String password = new String (Passtxt.getPassword());
    if (IDtxt.getText().equals ("")) {
                        JOptionPane.showMessageDialog (null, "Member's Id not Provided.");
                        IDtxt.requestFocus();
    else if (Usertxt.getText().equals ("")) {
                        Usertxt.requestFocus();
                        JOptionPane.showMessageDialog (null, "Username not Provided.");
                   else if (password.equals ("")) {
                        Passtxt.requestFocus();
                        JOptionPane.showMessageDialog (null, "Password not Provided.");
                   else {
                        try {     //INSERT Query to Add Book Record in Table.
                             String q = "UPDATE UsrTable "+"SET UsrName = '"+Usertxt.getText() + "' " +
    "AND Password = '" + password + "'"+"WHERE ID = '" + ID + "'";
                             int result = st.executeUpdate(q);                              if (result == 1) {               .
                                  JOptionPane.showMessageDialog (null, "New User has been Created.");
                                  Usertxt.setText ("");
                                  Passtxt.setText ("");
                                  Usertxt.requestFocus ();
                             else {                                                        JOptionPane.showMessageDialog   (null, "Problem while Creating the User.");
                                  Usertxt.setText ("");
                                  Passtxt.setText ("");
                                  Usertxt.requestFocus ();
                        catch (SQLException sqlex) { }
    and heres the error...
    java.lang.NullPointerException
    at CreateAcc$3.actionPerformed(CreateAcc.java:179)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5100)
    at java.awt.Component.processEvent(Component.java:4897)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • XSU : Updating records in the table

    Hi,
    XSU seems to be assuming that the data from the XML doc has to be always INSERTED into the database. Does it not have to UPDATE existing records and INSERT only the NEW RECORDS?
    How should this be implemented?
    null

    A future release is planned to offer this so-called "upsert" functionality, but the current release requires you to know whether you want to insert, update, or delete.
    You can use the insert functionality, in combination with an INSTEAD OF INSERT trigger to programmatically handle the "update-if-already-exists" functionality.
    See Example 12-17 on page 465 of "Building Oracle XML Applications" for a concrete example of this hand-coded "upsert" functionality.

  • Problem while updating record in the database

    I have created an entity object, view object and a form to show that. whenever i update some field in the form and try to commit the change, exception is thrown stating that-
    (oracle.jbo.DMLException) JBO-26080: Error while selecting entity for Countries
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) [DataDirect][SQLServer JDBC Driver][SQLServer]FOR UPDATE cannot be specified on a READ ONLY cursor.

    I'm getting the same problem. Did you manage to fix this?

  • Failed to update in the Item Master Form ATO field checked

    Hi All ,
    I am trying to implement B2B ( Back to Back Order ) and to implement the B2B the ATO should be checked irrespective of Manufacturing is installed or not.
    Now the problem is I am able to update some of the item but failed to update some of the item and it gives error " the Sales Order Line is opened you can not
    check the ATO".
    Now I did to avoid this I updated the columns BUILD_IN_WIP_FLAG to 'Y' and REPLENISH_TO_ORDER_FLAG = 'Y' in the Item master table .
    And I was successfully able made further transaction of the open sales order line.
    I wanted to know to updating the field BUILD_IN_WIP_FLAG to 'Y' and REPLENISH_TO_ORDER_FLAG = 'Y' will impact our bussiness in Future.
    Regards,
    Sharad

    Hello Sharad,
    First thing, if you are implementing B2B in your system then your organization is a Manufacturing organization or distribution organization?
    If this is not a Manufacturing organization, then the item should be a Buy Item along with ATO attribute enabled. So that the B2B requisition created & then PO.
    If you are implementing Assemble to Order in Manufacturing organization, then your ordered item should be a make item not a buy item. For this sub assembly or finally assembly you need to define the bill, routing etc. After that once you book the ATO sales order, the work order will be created. & the process continues.
    The error "the Sales Order Line is opened you cannot check the ATO", comes when you are having open sales order exists & you are trying to update item attributes. It is always advisable to close all the sales order lines in this case before changing the same.
    Unless & until you are using BOM & WIP in your organization, change of BUILD_IN_WIP_FLAG will not affect. Please make sure not to update these attributes from backend using database update script.
    Regards,
    Jyoti Ranjan Mohanty

  • Updating records

    helloo..
    i have a java application that will add records , search and update records in the database..
    i have the fields id,name,phone,address,sex and dob..
    i will be having an update button , whenever the user will click on the update button he can update the record he wants and then the updated record will be stored..but i don't know how to write the code for this ..
    can any one help me by giving me a sample code...
    this is my application code:
    import java.sql.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class Insert3 extends JFrame implements ActionListener
         JTextField id, name,address,phone,sex,dob;
         JButton add,update;
         JPanel panel, buttonPanel;
         static ResultSet res;
         static Connection conn;
         static Statement stat;
         static String[][] tableData;
         JTable dataTable;
         Container c = getContentPane();
         JScrollPane scrollpane;
         //private ImageIcon logo;
    public static void main (String[] args)
              Insert3 worker = new Insert3();
              try
                        //Connect to the database and insert some records:
                             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                             Connection conn = DriverManager.getConnection("jdbc:odbc:database");//database is the DSName
                             stat = conn.createStatement();
                             /*stat.executeUpdate("INSERT INTO Customer VALUES (1001, 'Simpson','hamad town',222,'m','may 72')");
                             stat.executeUpdate("INSERT INTO Customer VALUES (1002, 'McBeal','isatown',333,'f','jan 79')");
                             stat.executeUpdate("INSERT INTO Customer VALUES (1003, 'Flinstone','hamad town',292,'m','may 72')");
                             stat.executeUpdate("INSERT INTO Customer VALUES (1004, 'Cramden','hamad town',987,'m','may 72')");
                             stat.executeUpdate("INSERT INTO Customer VALUES (1004, 'Cramden','hamad town',987,'m','may 72')");
                             stat.executeUpdate("INSERT INTO Customer VALUES (1004, 'Cramden','hamad town',987,'m','may 72')");*/
                   }//try
              catch(Exception e)
                        System.out.println("Caught exception in main: " +e);
                   }//catch
    //Create the JTable and build the GUI..
         worker.updateTable();
         }//main
    //===========================================================================================================================
    void makeGUI()
              c.setLayout(new BorderLayout());
              id = new JTextField(20);
              name = new JTextField(20);
              address=new JTextField(20);
              phone=new JTextField(20);
              sex=new JTextField(20);
              dob=new JTextField(20);
              add = new JButton("ADD");
              update=new JButton("UPDATE");
              panel = new JPanel();
              buttonPanel = new JPanel(new GridLayout(3,4));
              buttonPanel.add(new JLabel("ID",JLabel.CENTER));
              buttonPanel.add(id);
              buttonPanel.add(new JLabel("Name",JLabel.CENTER));
              buttonPanel.add(name);
              buttonPanel.add(new JLabel("Address",JLabel.CENTER));
              buttonPanel.add(address);
              buttonPanel.add(new JLabel("Phone",JLabel.CENTER));
              buttonPanel.add(phone);
              buttonPanel.add(new JLabel("Sex",JLabel.CENTER));
              buttonPanel.add(sex);
              buttonPanel.add(new JLabel("Date Of Birth",JLabel.CENTER));
              buttonPanel.add(dob);
              panel.add(add);
              panel.add(update);
              add.addActionListener(this);
              search.addActionListener(this);
              pack();
              setVisible(true);
         }//makeGUI
    //===========================================================================================================================
    public void actionPerformed(ActionEvent e)
              if(e.getSource() == add)
              if(id.getText().equals("") || name.getText().equals("") || address.getText().equals("") || phone.getText().equals("") || sex.getText().equals("")|| dob.getText().equals(""))
              JOptionPane.showMessageDialog(null,"Please fill in the missing fields","Missing Fields!!!",JOptionPane.INFORMATION_MESSAGE);
                   try
                        String idInput = id.getText();
                        if(idInput.equals(""))
                        idInput = "0";
                        int userId = Integer.parseInt(idInput);
                        String userName = name.getText();
                        String userAddress = address.getText();
                        String userPhone = phone.getText();
                        String userSex = sex.getText();
                        String userDateBirth = dob.getText();
                        //logo=new ImageIcon("C:\My Documents\SENIOR\diagonal.jpg");
                        //Image img = Toolkit.getDefaultToolkit().getImage("diagonal.jpg");
                        String sql = "INSERT INTO CUSTOMER VALUES ('"+userId+"', '"+userName+"', '"+userAddress+"', '"+userPhone+"', '"+userSex+"', '"+userDateBirth+"')";
                        stat.executeUpdate(sql);
                        id.setText("");
                        name.setText("");
                        address.setText("");
                        phone.setText("");
                        sex.setText("");
                        dob.setText("");
                        updateTable();
                        repaint();
    }//try
                   catch(Exception ee)
                        System.out.println("Caught exception in actionPerformed: "+ee);
                   }//catch
    }//if
    if(e.getSource()==update)
                   String idEntered = id.getText();
                   String enteredName=name.getText();
                   String enteredPhone=phone.getText();
                   String enteredSex=sex.getText();
                   String enteredDob=dob.getText();
                   try
                   catch(Exception eee)
                                       System.out.println("Caught exception in actionPerformed: "+eee);
                   }//catch
         }//else
         }//actionlistener
    //===========================================================================================================================
    void updateTable()
         try
                   int rowNumbers = 0;
                   //Get the number of rows in the table so we know how big to make the data array..
                   ResultSet results = stat.executeQuery("SELECT COUNT(*) FROM CUSTOMER");
                   while(results.next())
                             rowNumbers = results.getInt(1);
                        }//while
                   System.out.println("Rows: "+rowNumbers);
                   tableData = new String[rowNumbers][6];
                   int currentRow = 0;
                   ResultSet results1 = stat.executeQuery("SELECT * FROM CUSTOMER");
                   while(results1.next())
                             tableData[currentRow][0] = results1.getString(1);
                             tableData[currentRow][1] = results1.getString(2);
                             tableData[currentRow][2] = results1.getString(3);
                             tableData[currentRow][3] = results1.getString(4);
                             tableData[currentRow][4] = results1.getString(5);
                             tableData[currentRow][5] = results1.getString(6);
                             currentRow++;
                        }//while
    //===============================================
    //Create the table model:
    final String[] colName = {"Id", "Name","Address","Phone","Sex","Date OF Birth"};
    TableModel pageModel = new AbstractTableModel()
         public int getColumnCount()
              return tableData[0].length;
         }//getColumnCount
         public int getRowCount()
              return tableData.length;
         }//getRowCount
    public Object getValueAt(int row, int col)
              return tableData[row][col];
    }//getValueAt
         public String getColumnName(int column)
              return colName[column];
    }//getcolName
         public Class getColumnClass(int col)
              return getValueAt(0,col).getClass();
         }//getColumnClass
         public boolean isCellEditable(int row, int col)
              return false;
    }//isCellEditable
         public void setValueAt(String aValue, int row, int column)
              tableData[row][column] = aValue;
    }//setValueAt
    };//pageModel
    //===========================================================================================================================
    //Create the JTable from the table model:
    dataTable = new JTable(pageModel);
    //===========================================================================================================================
    if(scrollpane != null)
              scrollpane.setVisible(false);
              scrollpane = null;
         }//if
    scrollpane = new JScrollPane(dataTable);
    scrollpane.setVisible(true);
    if(buttonPanel == null)
         makeGUI();
         c.add(buttonPanel, BorderLayout.NORTH);
         c.add(panel, BorderLayout.CENTER);
         c.add(scrollpane, BorderLayout.SOUTH);
         id.grabFocus();
         pack();
    }//try
    catch(Exception e)
    System.out.println("Caught updateTable exception: "+e);
    }//catch
    }//updatetable
    }//Jframe
    i did the add part but know i'm stuck with the update..well this is my first time to work with databases using java ..
    so please can someone help
    thankx

    Yes, I want find out how it works and what was the cause the program could not work.

  • Why won't Photoshop CS6 Extended update? I keep getting a failed to update message.

    Why won't Photoshop CS6 Extended update? I keep getting a failed to update message.

    Run the Creative Suite Cleaner Tool, reinstall the program, try again.
    Mylenium

  • Compare several records in the same table

    Hello, i´m writing a BAT file so i can export some information that i query.
    I have a automatic integration that from time to time checks if there is any new client´s and generates a trigger.
    If an error ocurs i it will repeat the process until the client is in the database.
    I cannot create tables or modify structure.
    My problem is that i need to compare the most updated record with the field CLIENT_ID
    Let me give up an example:
    Table A
    CLIENT_ID CREATEDTIME ERROR_MESSAGE
    0 01-01-2009 Sucess
    1 01-01-2009 Error
    2 01-01-2009 Sucess
    1 02-01-2009 Sucess
    3 02-01-2009 Sucess
    4 02-01-2009 Error
    I need to compare client "1" created on 01-01-2009 that gived Error with all new records to see if is Sucess and my
    query should only return the client_ID "4" and export with sqlplus
    Could you please help me out?

    with my_tab as (select 0 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 1 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Error' error_message from dual union all
                    select 2 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 1 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 3 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 4 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Error' error_message from dual)
    -- end of test data set up to mimic a table called "my_tab"
    select client_id
    from   my_tab
    group by client_id
    having max(decode(error_message, 'Error', 1, 2)) = 1;should do what you want.
    Edited by: Boneist on 05-Jan-2009 16:06
    Hmm, not quite.... thinking of an amendment if the answer to BluShadow's question is Yes
    Aha,
    with my_tab as (select 0 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 1 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Error' error_message from dual union all
                    select 2 client_id, to_date('01/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 1 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 3 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Sucess' error_message from dual union all
                    select 4 client_id, to_date('02/01/2009', 'dd/mm/yyyy') createdtime, 'Error' error_message from dual union all
                    select 1 client_id, to_date('03/01/2009', 'dd/mm/yyyy') createdtime, 'Error' error_message from dual)
    -- end of test data set up to mimic a table called "my_tab"
    select client_id
    from   my_tab
    group by client_id
    having max(decode(error_message, 'Error', 1, 2)) keep (dense_rank last order by createdtime) = 1;(which happens to be a more generalised form of what Frank's posted below!)

  • Update record using SQL statement

    I have VB6.0 and Oracle 10G Express Edition in Windows 2000 Server. My procedure in VB 6.0 can't update record in the table using SQL statement, and the Error Message is " Missing SET keyword ".
    The SQL statement in VB6.0 look like this :
    General Declaration
    Dim conn as New ADODB.Connection
    Dim rs as New ADODB.Recordset
    Private Sub Command1_Click()
    dim sql as string
    sql = " UPDATE my_table " & _
    " SET Name = ' " & Text3.Text & " ' " & _
    " AND Unit = ' " & Text2.Text & " ' " & _
    " WHERE ID = ' " & Text1.Text & " ' "
    conn.Execute (sql)
    Private Sub Form Load()
    Set conn = New ADODB.Connection
    conn.Open "Provider=MSDASQL;" & "Data Source=my_table;"& "User ID =marketing;" & "Password=pass123;"
    I'm sorry about my language.
    What's wrong in my SQL statement, I need help ........ asap
    Best Regards,
    /Harso Adjie

    The syntax should be
    UPDATE TABLE XX
    SET FLD_1 = 'xxxx',
    FLD_2 = 'YYYY'
    WHERE ...
    'AND' is improperly placed in the SET.

  • EDT Cat. 15 Data loaded to SAP but failed when updating

    Hi,
    I have an structure to load data into BP using KCLJ with Cat 15.
    Here it is.
    AKTYP
    TYPE
    PARTNER
    ROLE1
    KUNNR
    KUNNR_EXT
    BU_GROUP
    FIBUKRS
    CHIND_ADDR
    NAME_CO
    NAME_ORG1
    NAME_ORG2
    STREET
    STR_SUPPL1
    STR_SUPPL2
    STR_SUPPL3
    LOCATION
    HOUSE_NUM1
    POST_CODE1
    CITY1
    COUNTRY
    REGION
    LANGU
    CHIND_TEL
    TEL_NUMBER
    TEL_EXTENS
    We had the data loaded to SAP with ROLE 000000 and TR0100 but somehow when we tried to update the address thru ROLE TR0100, we had a dump and failed to update. However, the update is good when we use ROLE 000000 to update.
    Anyone would have a clue of this?
    Thanks

    I am new to EDT also. I know Cat 15 which can load BP. SAP has more categories which can load more using KCLJ. Here's my experience.
    Under Tcode SIMGH, find IMG structure External Data Transfer for SAP Banking. Under that structure, you can find Display Required and Optional Entry Fields for SEM Banking. When you enter 15 in the Category box, you'll see a whole list of fields about BP. You can use these fields to create your own structure.
    After you created your structure, use Define Sender Structure under External Data Transfer for SAP Banking to define your structure. After that, it is done. You can try use KCLJ to load your BP.
    If you still have other issues, mostly will be the configuration.
    Enjoy.

  • Application Manager Failed to Update Itself

    When I booted up my Windows 7 system on Monday I was prompted to update Adobe CS6 applications. Application manager (which had been working fine since last year) failed to update itself. The Application Manager icon disappeared from my desktop and Application Manager no longer appears on the start menu. However, when I opened Photoshop CS6 and ran an update, Application Manager opened and successfully ran updates on four installed applications.
    A phone support technician suggested finding and running the adobeapplicationmanager.exe executable already installed on my system. I did, but Application Manager failed again. I downloaded and ran Adobe Support Advisor. It reported "cpsid 82829s1 A restart is pending" and created support package 40-92950-074702072013. I have restarted the system with no effect.
    How do I restore desktop access to Application Manager?

    Ok then I would recommend reviewing your installation logs to determine the root cause of your installation difficulties.  You can find details on how to locate and interpret the installation log files at Troubleshoot with install logs | CS5, CS5.5, CS6 - http://helpx.adobe.com/creative-suite/kb/troubleshoot-install-logs-cs5-cs5.html.
    Please feel free to post to this discussion any specific errors you might have questions on.

  • Updating records in batch

    Hi,
    I have around 1 laks records in my database in one table.
    I have to update one field of those records.
    I do not want to update all records at a time, because its a production database.
    There is no any range field avaialbe on that table.
    Can somebody help me for doing this activity.
    I want to update records in the batch, say of 500 or 1000.
    Best regards,
    Kiran

    Why can't you just update all the rows? 100,000 rows isn't all that many these days, and Oracle locking is such that you would only lock users that were trying to update one of those rows, not insert a new row, for the length of the transaction. Is that really a problem? On my puny laptop, updating twice that many rows happens in 12 seconds
    SCOTT @ jcave102 Local> create table a( col1 number );
    Table created.
    Elapsed: 00:00:00.12
    SCOTT @ jcave102 Local> insert into a select rownum from all_objects;
    42492 rows created.
    Elapsed: 00:00:10.29
    SCOTT @ jcave102 Local> insert into a select * from a;
    42492 rows created.
    Elapsed: 00:00:01.75
    SCOTT @ jcave102 Local> insert into a select * from a;
    84984 rows created.
    Elapsed: 00:00:01.51
    SCOTT @ jcave102 Local> commit;
    Commit complete.
    Elapsed: 00:00:00.01
    SCOTT @ jcave102 Local> select count(*) from a;
      COUNT(*)
        169968
    Elapsed: 00:00:00.04
    SCOTT @ jcave102 Local> update a set col1=col1+1;
    169968 rows updated.
    Elapsed: 00:00:11.93If it is a problem, are you sure that other sessions reading data that's in the middle of being changed isn't a problem?
    How will you handle the situation where your program dies in the middle? How will you know which rows have been processed and which have not?
    Justin

Maybe you are looking for

  • Something very strange is happening with the adjustment brush

    When I brush over an area of a photo with the adjustment brush, LR does not select all of the area I brushed over, regardless how many times I go over it.  The unselected spots look like pepper sprinkled on mashed potatoes, small dots that will not s

  • Local interfaces classnotfound exception!

    Hello, I am working on a mdb which reference locally a session bean When I try to deploy my jar file I have got an error: RemoteException : java.rmi.ServerException: RemoteException occurred in server t hread; nested exception is: java.rmi.RemoteExce

  • Unable to upload photos manually to photostream

    I have an Apple TV and a iPhone 4S. My goal is view pictures on Applet TV not only just from iPhone but from my SLR camer a as well. I also dont want every picture that I take on my iPhone to be uplaoded to Photostream. Reading at various answers in

  • Excess network traffic - what's causing it?

    I recently purchased a Mac Mini Server and today I reinstalled my server software to try to fix some permission problems. Anyway, I must have turned something on or off incorrectly because my network traffic suddenly started going through the roof fo

  • FUSE Preprocessing Filesystem

    EDIT: Updated code, does everything I need it to for now, still maybe a little unclean, but much better than it was. A while ago I was thinking up ways to pre-process files such as .Xdefaults when they were read, to allow per machine configs and othe