Repaint One Row at a Time

Hi,
I have a graphical program that repaints every 2000 ms. I want to call another program that queries the Oracle dbase and returns one row at a time, so that in the graphical program, I see the value of the next row every 2000 ms. Any ideas on how I'd do this?
I have the basics on resultsets and statements and using while(rs.next()), etc.. Thanks. Chris.

Insert "Thread.sleep(2000);" at places where you want your program to wait for 2000 milliseconds.

Similar Messages

  • How to send data one row at a time from xml to flex

    I want to setTimerEvent while sending data from xml to flex, one row at a time.
    I have attached the xml.
    Thanks in advance.

    Hi Greg,
    Thanks for the reply. You must have seen the xml which i have attached.Here is the .mxml code which i have written:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="accountData.send()">
    <mx:Script>
    <![CDATA[
    import mx.controls.*;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    [Bindable]
    private var AccountInformation:ArrayCollection;
    private function AccountHandler(evt:ResultEvent):void
        AccountInformation = evt.result.xml.AccInfo;
    private function faultHandler(evt:FaultEvent):void
        var faultMessage:String = "Could not connect with XML file";
        Alert.show(faultMessage, "Error opening file");
    ]]>
    </mx:Script>
    <mx:HTTPService id="accountData" url="pgm1.xml" result="AccountHandler(event)" fault="faultHandler(event)"  />
    <mx:DataGrid x="20" y="24" width="950" dataProvider="{AccountInformation}" />
    </mx:Application>
    This reads and displays all the rows. But I want to display single row at a time with sometime time gap between the display of two consecutive rows.I am new to flex and this is my first code, so need your help on this.
    I hope i have made myself clear. If there is anything else please let me know.
    Looking forward to some solution.
    Thanks in advance.
    Regards,
    praj58

  • Adding Just One Row at a Time

    Multiple users can add Comments to a table, once added, the comments should be read only. How would I go about creating a region that will add just one row at a time, clear the region and then allow the adding of another row and not allow access to existing data rows?
    Jeff

    This example is doing exactly that:
    http://apex.oracle.com/pls/otn/f?p=31517:170
    Once added, the row can not be changed any more.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Selecting only one row at a time

    Hi experts,
    i have following doubt regarding selecting rows from a db:
    Is there any way of selecting only one row AT A TIME from a dabase just to collect the data in rows instead of in a unique document containing all the rows?
    I would like you to ellaborate on this as i need to send only one row to the IE, and then other row, and so on... without throwing any error!
    I have seen that there are SELECT SINGLE and SELECT UP TO 1 ROW, but these two methods are only useful when retrieving only one row, and that does not match my requirements. I need to process all the rows but one by one..
    I know that we can use the receiver jdbc adapter as if it was a sender by means of its specific datatype, but how to do it row by row??
    Hope i had explained well..
    Thanks in advance and best regards,
    David

    Hi kiran,
    Yes, my table has 5 not null fields but i am selecting and updating fixes values so i think that I will definetely go for the next solution:
    SELECT * FROM t1 WHERE status='0' and ROWNUM<2;
    UPDATE t1 SET status='1' WHERE status='0' and ROWNUM<2;
    My only concern is if the update will take the same row that the select.... BTW, I think it will
    ..What do you guys think?
    I ve been trying to operate with your proposed queries but i received some errors. Your queries are very interesting but i think that with the above ones i meet my requirements as the status field will be 0 for not processed rows and 1 for precessed ones (and the update will look for the row that meets the same 'where' clause than the select, and then, and only then, it will set status='1').
    The only thing i have to care about is what i questioned before.
    Thanks a lot and best regards,
    David

  • Update one row at a time, Data Grid

    Is it possible to update one row of a mx:DataGrid at a time.  I want to be able to have a user push a button and info populates one row of the data grid, user changes some properties and pushes the button again and another row of values populate the DataGrid.  Everything I see does a mass population from an XML or what have you.
    Thanks

    I did this this to work, so for those of you who may find this info helpfull here is how I solved the issue.
    I instantiated an ArrayCollection object like so:
    private var _rowValues:ArrayCollection = new ArrayCollection();
    I simply referenced the .addItem() property of my ArrayCollection.
    I then added values to the ArrayCollection as follows
    _rowValues.addItem({Ingredient:ingredient, Amount:amount, Category:category}); //dataField:value
    and referenced the dataField proerpty of the DataGrid... so in my case my 3 dataField properties (in my mxml compontent) were as fillows:
    dataField="Ingredient"
    dataField="Amount"
    dataField="Category"
    all done, and it works.

  • Edit Appraisals:  Notes only shows one row at a time

    Under the Employee Review tab of MSS-->Edit Appraisals, when I click to create an appraisal, the appraisal form in our system has areas to add notes.  However, in the portal, the area to add notes is only 1 row.  It is scrollable, but you can only see one row of text at a time.  How can I expand the notes area/editor to show multiple lines of text?

    Turns out the configuration is on the R/3 side when setting up the Appraisal.  There is an option for number of lines for notes.

  • My table lists only up one row at a time. dynamic don't work

    Hi!
    I have a table that consists of: ID, NAME, LINK and
    CONTENTID.
    It's 5 records in it at the moment.
    I create a recordset.
    I choose all (ID, NAME, LINK and CONTENTID).
    It only shows up ONE row. I mark the table and choose
    repeating behavior. I still only get up one row.
    I follow this tutorial:
    http://www.adobe.com/support/dreamweaver/building/users_delete_rcrds_php/users_delete_rcrd s_php03.html
    I use Dreamweaver CS3.
    Any good advice, cause I haven't got a clue.
    I've tried everything: the embassy, the German government,
    the consulate. I even talked to the U.N. ambassador. It's no use, I
    just can't bring my wife to orgasm.
    Marw

    Can't get it to work. But I start off with this:
    1.
    http://img521.imageshack.us/my.php?image=01tablexk1.png
    After I follow your instructions, and mark
    name I get this:
    http://img514.imageshack.us/my.php?image=02trselectedzg6.png
    But still I only get one post and have to use a Recordset
    navigation bar instead.
    Marw

  • Editing one row at a time in a table control

    Good day all
    I need your urgent assistance with the problem below:
    At first time load, the table control needs to allow input on the first line only, validation will then be done through clicking a “check” button.  After the check has been done, table control needs to open up the second row for input and grey out the first one. This sequence needs to follow every time a check has been performed.
    After the check has been done, table control needs to show the previously entered data on the first line but grey it out, and open up only the second row for input.
    The table control has been created using a wizard with an internal table and I am working on dialog/screen programming. The table control has been created as an output control but it needs to perform as both and output and input control.
    I have made changes to the “MODULE tc_create_ph2_get_lines OUTPUT.” Which is created by the wizard as follows:
    The module is in the PBO Section.
    IF it_tab is initial.                                                                 "it_tab being the internal table that stores the data from the table control                        
         DESCRIBE TABLE it_tab LINES lv_num.
               LOOP AT SCREEN.
           IF tc_create_ph2-current_line <> 1.
             screen-input = 0.
             MODIFY SCREEN.
           ENDIF.
         ENDLOOP.
       ELSE.
    tc_create_ph2-current_line = lv_num + 1.
         LOOP AT SCREEN.
           IF tc_create_ph2-current_line <> lv_num + 1 .
             screen-input = 0.
             MODIFY SCREEN.
           ENDIF.
         ENDLOOP.
       ENDIF.
      Your assistance will be highly appreciated.

    Hi Dineo,
    This module would make all line non editable except the last line, which will be open for input.
    LOOP AT IT_ST INTO WA_ST WITH CONTROL MATERIAL CURSOR
    MATERIAL-CURRENT_LINE.
        module mod_screen.
       ENDLOOP.
    module MOD_SCREEN output.
       data : tc_lines type n.
       describe table it_st LINES tc_lines.
    *  loop at screen.
         if material-current_line le tc_lines.
          loop at screen.
           screen-input = 0.
           modify screen.
           endloop.
          endif.
    endmodule.
    When checking and saving data, after saving data delete all lines of tc internal table except the last added row, if you want only the last record to appear in the table.

  • Add more than one row at a time

    How do I add multiple rows in one step? I periodically d/l a small sheet of data and paste it into a master sheet. I have to add enough rows between the data and the summary row one at a time. Is there a quicker way?
    Geoff

    Geoff,
    Let's say that you want to add 5 rows. Select the 5 rows just above where you want to add 5 more and select Table > Add Rows Below. A number of rows equal to the number you have selected will be added.
    Jerry

  • Changing background color in JTable, only changes one row at a time...

    I'm trying to change the color of rows when the 5th column meets certain criteria. I think I'm very close, but I've hit a wall.
    What's happening is the row will change color as intended when the text in the 5th column is "KEY WORD", but when I type "KEY WORD" in a different column it will set the first row back to the regular colors. I can easily see why it's doing this, everytime something is changed it rerenders every cell, and the listener only checks the cell that was just changed if it met the "KEY WORD" condition, so it sets every cell (including the previous row that still meets the condition) to the normal colors. I can't come up with a good approach to changing the color for ALL rows that meet the condition. Any help would be appreciated.
    In this part of the CellRenderer:
            if (isSelected)
                color = Color.red;
            else
                color = Color.blue;
            if (hasFocus)
                color = Color.yellow;
            //row that meets special conditions
            if(row == specRow && col == specCol)
                color = color.white; I was thinking an approach would be to set them to their current color except for the one that meets special conditions, but the two problems with that are I can't figure out how to getColor() from the table, and I'm not sure how I would initially set the colors.
    Here's the rest of the relevant code:
        public void tableChanged(TableModelEvent e)
            int firstRow = e.getFirstRow();
            int lastRow  = e.getLastRow();
            int colIndex = e.getColumn();
            if(colIndex == 4)
                String value = (String)centerTable.getValueAt(firstRow, colIndex);
                // check for our special selection criteria
                if(value.equals("KEY WORD"))
                    for(int j = 0; j < centerTable.getColumnCount(); j++)
                        CellRenderer renderer =
                            (CellRenderer)centerTable.getCellRenderer(firstRow, j);
                        renderer.setSpecialSelection(firstRow, j);
    import javax.swing.table.*;
    import javax.swing.*;
    import java.awt.Component;
    import java.awt.Color;
    public class CellRenderer extends DefaultTableCellRenderer
        int specRow, specCol;
        public CellRenderer()
            specRow = -1;
            specCol = -1;
        public Component getTableCellRendererComponent(JTable table,
                                                       Object value,
                                                       boolean isSelected,
                                                       boolean hasFocus,
                                                       int row, int col)
            setHorizontalAlignment(JLabel.CENTER);
            Color color = Color.green;
            if (isSelected)
                color = Color.red;
            else
                color = Color.blue;
            if (hasFocus)
                color = Color.yellow;
            if(row == specRow && col == specCol)
                color = color.white;
            //setForeground(color);
            setBackground(color);
            setText((String)value);
            return this;
        public void setSpecialSelection(int row, int col)
            specRow = row;
            specCol = col;
    }If I'm still stuck and more of my code is needed, I'll put together a smaller program that will isolate the problem tomorrow.

    That worked perfectly for what I was trying to do, but I've run into another problem. I'd like to change the row height when the conditions are met. What I discovered is that this creates an infinite loop since the resizing triggers the renderer, which resizes the row again, etc,. What would be the proper way to do this?
    Here's the modified code from the program given in the link. All I did was declare the table for the class, and modify the if so I could add the "table.setRowHeight(row, 30);" line.
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    public class TableRowRenderingTip extends JPanel
        JTable table;
        public TableRowRenderingTip()
            Object[] columnNames = {"Type", "Company", "Shares", "Price", "Boolean"};
            Object[][] data =
                {"Buy", "IBM", new Integer(1000), new Double(80.5), Boolean.TRUE},
                {"Sell", "Dell", new Integer(2000), new Double(6.25), Boolean.FALSE},
                {"Short Sell", "Apple", new Integer(3000), new Double(7.35), Boolean.TRUE},
                {"Buy", "MicroSoft", new Integer(4000), new Double(27.50), Boolean.FALSE},
                {"Short Sell", "Cisco", new Integer(5000), new Double(20), Boolean.TRUE}
            DefaultTableModel model = new DefaultTableModel(data, columnNames)
                public Class getColumnClass(int column)
                    return getValueAt(0, column).getClass();
            JTabbedPane tabbedPane = new JTabbedPane();
            tabbedPane.addTab("Alternating", createAlternating(model));
            tabbedPane.addTab("Border", createBorder(model));
            tabbedPane.addTab("Data", createData(model));
            add( tabbedPane );
        private JComponent createAlternating(DefaultTableModel model)
            JTable table = new JTable( model )
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    //  Alternate row color
                    if (!isRowSelected(row))
                        c.setBackground(row % 2 == 0 ? getBackground() : Color.LIGHT_GRAY);
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        private JComponent createBorder(DefaultTableModel model)
            JTable table = new JTable( model )
                private Border outside = new MatteBorder(1, 0, 1, 0, Color.RED);
                private Border inside = new EmptyBorder(0, 1, 0, 1);
                private Border highlight = new CompoundBorder(outside, inside);
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    JComponent jc = (JComponent)c;
                    // Add a border to the selected row
                    if (isRowSelected(row))
                        jc.setBorder( highlight );
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        public JComponent createData(DefaultTableModel model)
            table = new JTable( model )
                public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
                    Component c = super.prepareRenderer(renderer, row, column);
                    //  Color row based on a cell value
                    if (!isRowSelected(row))
                        c.setBackground(getBackground());
                        String type = (String)getModel().getValueAt(row, 0);
                        if ("Buy".equals(type)) {
                            table.setRowHeight(row, 30);
                            c.setBackground(Color.GREEN);
                        if ("Sell".equals(type)) c.setBackground(Color.YELLOW);
                    return c;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            table.changeSelection(0, 0, false, false);
            return new JScrollPane( table );
        public static void main(String[] args)
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
        public static void createAndShowGUI()
            JFrame.setDefaultLookAndFeelDecorated(true);
            JFrame frame = new JFrame("Table Row Rendering");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.add( new TableRowRenderingTip() );
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    }Edited by: scavok on Apr 26, 2010 6:43 PM

  • Deleting more than one row at a time

    Hey all,
    Im trying to be able to delete rows from my arraylist and UI table but im getting Index out of bounds exep.
    I think its because of the numbering, like counting through the i in the for loop is making it look at something different.
    Can anyone help?
    Thanks!
    selectedObjects = table.getSelectedRows();
                if (selectedObjects.length != 0)
                   for (int i = 0; i < selectedObjects.length; i++)
                        table.deleteRow(selectedObjects);
    rows.remove(selectedObjects[i]);

    I think its because of the numbering, like counting
    through the i in the for loop is making it look at
    something different.This is exactly correct.
    Personally I would look to see if those objects have a method named "clear" or "removeAll" or something like that, so you don't have to write that loop at all.
    But if you do have to write the loop, write a loop that continuously deletes the last entry until there aren't any more. This logic doesn't have the numbering problems that your code does.

  • Has anyone successfully implemented fetching more than one row at a time?

    I ask, since I'm having problems even with the simplest of scenarios. I went all the way back to the sample code given in the documentation (listed below) and it doesn't even work! I throws a data truncated exception on the employee number (even though the field is only 4 digits!) Help?
    int empno[5];
    char ename[5][11];
    ub2 enameLen[5];
    ResultSet *resultSet = stmt->executeQuery("select empno, ename from emp");
    resultSet->setDataBuffer(1, &empno, OCCIINT);
    resultSet->setDataBuffer(2, ename, OCCI_SQLT_STR, sizeof(ename[0]), enameLen);
    rs->next(5); // throws ORA-01406!

    pass the size of the number field too.
    resultSet->setDataBuffer(1, empno, OCCIINT, sizeof(empno[0]));
    ...

  • Only one row appendable at a time in alv

    I would like to limit only one blank row at a time in my alv grid. Means, if i append a row using the standard "Append Row" Button, the user should not be able to append a second blank row till he fills out the first one.
    Any hints ??
    regards,
    Priyank

    Hi Sascha,
    Thanks for the reply but it does not work.
    i put some code in the ...AFTER event, but it seems it is not executed on clicking the append button. I set a breakpoint there but it did not break.
    any other suggestions?
    my main problem is that when i append multiple rows in the alv and subsequently save the data from this alv grid, somehow one field is getting cleared and not holding the value the user has entered. for example, if i add 5 rows and then put data in these rows and save it, second row shows an initial value for a date field in the table. rest of the rows hold the correct value.  i don't know if it is a webdynpro bug or my mistake...i tried redoing everything but to no avail...same problem everywhere.
    thus i m trying to restrict the user to one row at a time only. it will be ideal if i can somehow solve the original problem. if not, even restricting to one row will be good enough.
    regards,
    Priyank

  • How to write one row of data at a time to "Write to File"

    I am trying to write 10 parameters to the LV "Write to File". This is for just one row at a time. This happens evertime I get a failure in my test routine. I am not quite sure how to accomplish this task. If I get another failure I write one row again. I testing 4 DUTS at a time so I write this row of data to each file. I am sure it is very simple.
    Thanks
    Philip

    Assuming your 10 parameters are an numeric array with 10 elements,  use "write to spreadsheet" file with append set to true. (... and if they are scalars, built the array first ).
    LabVIEW Champion . Do more with less code and in less time .

  • Vertical One Row Report

    Hi Everyone,
    I am trying to implement a SQL report and want it to be as Vertical One Row. I've found one solution which would work perfectly for me in here:
    [http://apex.oracle.com/pls/otn/f?p=11933:108]
    It displays one row at a time and it is vertical, basically that is what I need. The problem here is that I cannot make it working. I did everything according to instructions: did create a new report template as "Named Column (row template)", inserted code into "Row Template 1" and "Before Rows" and "After Rows". Have my SQL report ready as "No Template" in "Page Definition" . In "Layout and Pagination" set to my new report template. As a result it gave me that look and feel but no pagination so I can see 1 row at a time, Instead I see all my rows the same way as I would use "default: vertical" template. Any Ideas????
    Is there any other way to implement this?
    Thanks

    Hi,
    I am glad it is working now. But I was wondering if logging out and in again would help in this case... If the current pagination settings are stored against the username (rather than the session), logging out and in would not make a difference. Based on what you described, that may be the case.
    I think the best approach is the one indicated by fac586. The problem is that I can never remember after which colon to put that RP string!
    Luis

Maybe you are looking for

  • Error while deploying a webdynpro application

    Hi, Iam getting an error while deploying the application in nwds the error is like this com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to get deployable object part info for component com.labprocess.LabProcess1 what is the remedy

  • An unhandled exception has been thrown in the ESB system-400 Bad request

    Hi, When i try to call a ESB Routing Service in a BPEL Flow, i am getting the error below, An unhandled exception has been thrown in the ESB system. The exception reported is: "org.collaxa.thirdparty.apache.wsif.WSIFException: exception on JaxRpc inv

  • Consignment stock trasnfer

    HI. As per consignement my company is in india and it want to consignement fillup to US customer. But when u are doing consignement fillup there wont be any billing as per standard. But as per indian senario if goods are moving out from stock then th

  • Command line version of finder's get info command

    I am trying to find which version of MS Office 2008 is installed on a bunch of machines. On one machine, I can just do a get info on the MicrosoftComponentPlugin.framework, but I don't want to have to touch every machine. Does anyone know of a way to

  • I forgot the security questions I need to send me again

    I forgot the security questions I need to send me again