Update GUI during db query

Folks'es,
i have the following problem:
* i have to perform a database query during a drag operation
* the query can take quite some time
* while the query is performed, i would like to show at least some text in my GUI telling the user what happens
* i need to wait for the query to finish before i can continue.
question:
how can I update the GUI while a lengthy, synchronous operation is done on the event thread?
thomas
PS: i know about SwingUtilities.invokeLater() but i can't get it to do what i need (i'm too thick :().

I recommend the paintImmediately() method. Here is a
thread that shows it in action:
http://forum.java.sun.com/thread.jsp?forum=57&thread=23
114you're a hero! i must have been blind for the last 4 yrs!
thanx,
thomas

Similar Messages

  • Acrobat XI 11.0.06 update fails during install

    acrobat XI 11.0.06 update fails during install. Any advice or help? Here is the installer log contents:
    Jan 17 00:32:34 fox.local installd[5955]: PackageKit: ----- Begin install -----
    Jan 17 00:33:44 fox.local installd[5955]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “AcrobatUpd11006.pkg”." UserInfo=0x7fb9615c5160 {NSFilePath=./postinstall, NSURL=file://localhost/Volumes/AcrobatUpd11006/AcrobatUpd11006.pkg#payload.pkg, PKInstallPackageIdentifier=com.adobe.acrobat.a11.AcrobatUpd11006, NSLocalizedDescription=An error occurred while running scripts from the package “AcrobatUpd11006.pkg”.} {
            NSFilePath = "./postinstall";
            NSLocalizedDescription = "An error occurred while running scripts from the package \U201cAcrobatUpd11006.pkg\U201d.";
            NSURL = "file://localhost/Volumes/AcrobatUpd11006/AcrobatUpd11006.pkg#payload.pkg";
            PKInstallPackageIdentifier = "com.adobe.acrobat.a11.AcrobatUpd11006";
    Jan 17 00:33:44 fox.local Installer[11306]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
    Jan 17 00:33:44 fox.local Installer[11306]: Displaying 'Install Failed' UI.
    Jan 17 00:33:44 fox.local Installer[11306]: 'Install Failed' UI displayed message:'The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.'.

    You are right. There are a lot more self-support tools available in Windows
    than in MacOS. All you ever get on a Mac is "That didn't work: -304998173".
    Thanks for your insights.
    Re: acrobat XI 11.0.06 update fails during install
    created by Bill@VT <http://forums.adobe.com/people/Bill%40VT>  in Acrobat
    Installation & Update Issues - View the full discussion
    <http://forums.adobe.com/message/6040206#6040206>
    The upgrade is not the 11.0.06, but that is an update. The upgrade is what
    you can purchase if you had a previous version of Acrobat (at least AA 9).
    The upgrade is substantially less in price than the full product. With the
    upgrade you also have to have the SN of the previous product available for
    the install. That is why I asked about the upgrade. Once you install AA XI,
    then going to 11.0.06 is a free update (updates are changes in the
    sub-version and are done quarterly or when there is a critical security
    issue).  You can often fix installations by running a repair. In Windows
    that is done either from Help>Repair or from the Control Panel. I do not
    know the equivalent of the Control panel in the MAC. In any case I am glad
    you got it fixed.
    Please note that the Adobe Forums do not accept email attachments. If you
    want to embed a screen image in your message please visit the thread in the
    forum to embed the image at http://forums.adobe.com/message/6040206#6040206
    Replies to this message go to everyone subscribed to this thread, not
    directly to the person who posted the message. To post a reply, either reply
    to this email or visit the message page:
    http://forums.adobe.com/message/6040206#6040206 To unsubscribe from this
    thread, please visit the message page at
    http://forums.adobe.com/message/6040206#6040206. In the Actions box on the
    right, click the Stop Email Notifications link.  Start a new discussion in
    Acrobat Installation & Update Issues at Adobe Community
    <http://forums.adobe.com/choose-container!input.jspa?contentType=1&container
    Type=14&container=4714>  For more information about maintaining your forum
    email notifications please go to
    http://forums.adobe.com/thread/416458?tstart=0.

  • (paid support) Pacman Update GUI

    Below the project description. If you are interested in doing this programming job, please email/pm me.
    If there are questions, please reply to this post.
    Pacman Update GUI
    Archlinux (http://www.archlinux.org/) uses the pacman package manager. A number of GUI applications to control this package manager exist (http://wiki.archlinux.org/index.php/Pac … _Frontends), but none suit our needs.
    For this project you will need to design and implement two independent GTK+ applications: an Update Manager and an Update Applet. The Update Manager must be an application that guides the user through updating the system. The Update Applet must be an application which shows a systray icon. This application will check for updates once in a while and notify the user if there are updates.
    Both applications must be internationalized/localized and written in C, C++ or Python. The applications should have as little dependencies as possible. The applications must include installation scripts. The applications must be installed in compiled form. Any configuration needed for these tools should be systemwide. We do not need a gui for configuration.
    Update Manager
    The Update Manager must be an application that guides the user through the steps of updating the system with as little effort and as little user interaction as possible. You are expected to first define the minimal amount of steps required, design the application and then implement the application (gui and internals).
    There are two possibilities for this applications:
    1. You develop it from scratch.
    2. You modify the gnome update manager (used in eg ubuntu) to work with pacman.
    We will rely on your expertise to decide which approach is best.
    Update Applet
    The Update Applet provides a systray icon which checks for system updates in regular intervals. The applet should have a tooltip showing the update status, and a context menu with a few options, such as "Check for updates now", "About" and "start Update Manager". You are expected to design and implement the application.

    I don't get why you should allow your users to update their OS(that is their GUI, their kernel, xorg, libc and other _core_ functionality). These components are already quite "great" and shouldn't need upgrading if that is your worry. Only in the case of some new device coming out and the kernel or xorg need to support it i can see the problem. This should happen very rarely though. I mean, why should you allow your OS to be upgraded by some lowly non-tech users. I don't know of many workplaces which allow their users to upgrade their windows versions for example...
    You could always upgrade the OS every X years if needed.
    If the boss wants his emplyees to be able to download whichever apps/games they want then ofcourse you could allow this, but this should only be allowed if said apps/games doesn't drag in new versions of xorg, kernel versions or other core functionality or its dependencies.
    Just blacklist these in pacman.conf and make the file unwritable for the users...
    This way you only need external repo for apps which doesn't install without user intervention.
    Here i define "core functionality" as all the code responsible for giving a "working computer" as defined by the boss and you if he's not very IT. If you are worried about security and this is why you want a constantly updating machine then just connect all the machines to a router/firewall before they are allowed onto the net. That one could be an arch machine...
    Also I haven't tried xfce in a long while but you should watch against giving "windows users/mac users" anything which isn't glitzy and full-featured, because if the users doesn't think the OS have all the functionality they "need" and they don't think it looks fancy enough they have a tendency to go back to whatever OS they came from or try to "upgrade" their own os... which might spell problems for you.
    You know, never underestimate the ingeniousness of an idiot.
    Just my 5 cents.
    Last edited by test1000 (2010-06-25 00:13:42)

  • Updatable ResultSet for join Query

    Hi all,
    It is inevitable that i use a 'JOIN' operation for a particular query and i need the resultSet to be updated. Heard JDBC driver doesnt support this. Is there any workaround for this. Any help is really appreciated.
    Thanks,
    Abhijit

    Welcome to the forum!
    >
    It is inevitable that i use a 'JOIN' operation for a particular query and i need the resultSet to be updated. Heard JDBC driver doesnt support this.
    >
    As gimbal2 mentioned this isn't supported even by the latest 11g version and driver. See 'Result Set Limitations' in Chapter 17 of the JDBC doc for confirmation and discussion.
    http://docs.oracle.com/cd/E14072_01/java.112/e10589/resltset.htm#BABBCECI
    >
    Result Set Limitations
    The following limitations are placed on queries for enhanced result sets. Failure to follow these guidelines will result in the JDBC driver choosing an alternative result set type or concurrency type.
    To produce an updatable result set:
    A query can select from only a single table and cannot contain any join operations.
    In addition, for inserts to be feasible, the query must select all non-nullable columns and all columns that do not have a default value.
    A query cannot use SELECT * .
    However, there is a workaround for this.
    A query must select table columns only.
    It cannot select derived columns or aggregates, such as the SUM or MAX of a set of columns.
    >
    >
    Actually my exact requirement is i have two tables, earlier i used to select the results from one table and check for the existance of the corresponding record in the second table from the output of resultset. This is causing a lot of performance issue and i thought of using a single query by joining two tables which reduces the number of records.
    >
    So is this a correct description of what you want to do?
    1. TableA and TableB have one or more columns in common.
    2. Query TableA, possibly using filter predicates (WHERE tabA.col1 ...) and identify records in TableB that match on the join columns
    3. Update the TableB records from step #2.
    If so then you have a couple of options.
    The record-by-record approach would be to execute your current query (the one that joins the two tables) but retrieve ONLY the ROWID from TableB. Then iterate thru the result set and use a separate query to get each TableB record by using the ROWID retrieved from the first query. This is different from your original approach because the first query WILL identify the TableB records you need it just won't retrieve them (only the ROWID).
    Your original performance issues were probably because you were retrieving ALL of the TableA records and then checking each one to see if there were any TableB records for it.
    The BULK approach would be a slight modification of of the record-by-record approach but pushes the work to the DB server.
    This approach queries TableB to retrieve ONLY those records that EXIST in the query of TableA just described. So the query is of the form
    SELECT * FROM TableB b WHERE EXISTS (SELECT '1' FROM TableA a WHERE a.col1 = b.col1);  This query only uses one table for the resultset and does not contain any join operators so it can be updateable.
    Test a simple query first until you get the syntax correct.

  • How to see the last updates made during Power Nap?

    Hello guys,
    I am using MacBook Pro with Retina Display with Power Nap turned on. I think it's a great feature, but I wouyld like more control — to be able to see the updates it has made while sleeping.
    Is there any way to see the last updates made during Power Nap? Maybe some logs etc.

    You can see updates installed via Software Update by clicking on the Apple > About this Mac > more info > System Report > scroll down to Software > Installations. That is a comprehensive list - you won't find a separate list of the last hour or whatever (that I know of). There might be a terminal command for that - or not - I don't know of one.
    FWIW, I like to know what updates are being installed when, so I do not allow automatic download/installs of anything - I allow automatic checking so I get a notification that an update is available, but then I prefer to choose if/when I will download and install.

  • Is it safe to use SwingUtilities.invokeLater(), while updating GUI?

    Hi,
    I am updating GUI components in synchronized block which is runinng on main() thread my application hangs, but if I use SwingUtilities.invokeLater(...) then it runs fine.
    My question is:
    Is it safe to use SwingUtilities.invokeLater(...) in synchronized block.
    Edited by: Amol_Parekh on Nov 1, 2007 1:28 AM

    Paul Hyde in his "Java Thread Programming" (great book!!!) says it is.
    With invokeLater() you say to the Thread Scheduler you want that code to run on the Swing thread. In fact, if that is the only thing you do in the synchronized block I think it is unnecessary.
    Greetings,
    astrognom

  • UPDATE statement based on query and return multiple value

    Hi everybody,
    I have two tables: temp3 and temp
    One of them (temp3) should be updated based on the query where clause (id and flag columns).
    I run this query but it updates all of the records in the temp3. I want to update only records with 'UPDATED' flag.
    update temp3 t3
    set (id,name,address) = (select t.id, t.name, t.address from temp t, temp3 t3
    where t.id = t3.id and t.flag = 'UPDATED');
    Does any body know how I can do it?
    I appreciate your help
    Thx

    Hello
    Basically you're missing a where clause on your update statement to restrict rows in t3 to the ones that have a corresponding row in t1.
    SQL> select * from dt_test_t1;
            ID NAME                 ADDRESS              ROW_STATUS
             1 Joseph Bloggs        Some street          UPDATED
             1 Joe Bloggs           Old street           OLD
             2 Fredrick Bloggs      New street           UPDATED
             2 Fred Bloggs          Some street          OLD
             3 Robert Bloggs        Better street        UPDATED
             3 Bob Bloggs           Some street          OLD
           100 Barry Bethel         Some street          UPDATED
           200 Giles Brandreth      Some street          UPDATED
    8 rows selected.
    SQL> select * from dt_test_t3;
            ID NAME                 ADDRESS              ROW_STATUS
             1 Joe Bloggs           Old street
             2 Fred Bloggs          Some street
             3 Bob Bloggs           Some street
             4 Joe Smith            Some street
             5 John Doe             Some street
    --this update as it stands does not work as it updates rows to have
    --null name and address where there is not a proper matching row in
    --t1
    SQL> UPDATE
      2     dt_test_t3 t3
      3  SET
      4     (       t3.name,
      5             t3.address,
      6             t3.row_status
      7     ) = (SELECT
      8             t1.name,
      9             t1.address,
    10             t1.row_status
    11          FROM
    12             dt_test_t1 t1
    13          WHERE
    14             t1.id = t3.id
    15          AND
    16             t1.row_status = 'UPDATED'
    17         );
    5 rows updated.
    SQL> select * from dt_test_t3;
            ID NAME                 ADDRESS              ROW_STATUS
             1 Joseph Bloggs        Some street          UPDATED
             2 Fredrick Bloggs      New street           UPDATED
             3 Robert Bloggs        Better street        UPDATED
    4
    5
    SQL> rollback;
    Rollback complete.
    --Now add in the where clause to make sure we're only updating rows in
    --t3 that have a corresponding row in t1:
    SQL> UPDATE
      2     dt_test_t3 t3
      3  SET
      4     (       t3.name,
      5             t3.address,
      6             t3.row_status
      7     ) = (SELECT
      8             t1.name,
      9             t1.address,
    10             t1.row_status
    11          FROM
    12             dt_test_t1 t1
    13          WHERE
    14             t1.id = t3.id
    15          AND
    16             t1.row_status = 'UPDATED'
    17         )
    18  WHERE
    19     EXISTS( SELECT
    20                     NULL
    21             FROM
    22                     dt_test_t1 t1
    23             WHERE
    24                     t1.id = t3.id
    25             AND
    26                     t1.row_status = 'UPDATED'
    27             );
    3 rows updated.
    SQL> select * from dt_test_t3;
            ID NAME                 ADDRESS              ROW_STATUS
             1 Joseph Bloggs        Some street          UPDATED
             2 Fredrick Bloggs      New street           UPDATED
             3 Robert Bloggs        Better street        UPDATED
             4 Joe Smith            Some street
             5 John Doe             Some streetHTH
    David

  • Update basesd on a query

    Hi all,
    I need to perform a update based on a query which is returning mulitiple rows.
    update abc1 set (c1,c2) = (select c1,c2 from
    (select c1,c2 from abc
    minus
    select c1,c2 from abc1)
    where c1 in (select c1 from (select c1,c2 from
    (select c1,c2 from abc
    minus
    select c1,c2 from abc1) )));
    giving me error ERROR at line 1:
    ORA-01427: single-row subquery returns more than one row
    what another method i can use for it?????

    An update without an where condition? Strange!! I guess you want to insert the data not update.
    Here is your code. I formatted it.
    UPDATE abc1
       SET (c1, c2) =
                (SELECT c1,
                         c2
                    FROM
                       (SELECT c1,
                               c2
                           FROM abc
                          MINUS
                         SELECT c1,
                               c2
                           FROM abc1)
                  WHERE c1 IN (SELECT c1
                              FROM (SELECT c1,
                                       c2
                                     FROM (SELECT c1,
                                              c2
                                       FROM abc MINUS
                                       SELECT c1,
                                               c2
                                       FROM abc1))));I have no idea what you are trying to do here. Can you explain what you want to achieve?
    Thanks,
    Karthick.

  • TS3694 ?? I have Iphone 3G , when i update software & during iphone restore software 3.1.2. i got error 1602. how i can solve it

    ?? I have Iphone 3G , when i update software & during iphone restore software 3.1.2. i got error 1602. how i can solve it ?

    http://support.apple.com/kb/TS3694#USB

  • HT1338 Update fails during download of Aperture. I have 10.8.3

    Aperture update fails during download on my MacBook Pro laptop.

    Try setting up another admin user account to see if the same problem continues. If Back-to-My Mac is selected in System Preferences, the Guest account will not work. The intent is to see if it is specific to one account or a system wide problem. This account can be deleted later.
    Isolating an issue by using another user account
    If the problem is still there, try booting into the Safe Mode.  Shut down the computer and then power it back up. Immediately after hearing the startup chime, hold down the shift key and continue to hold it until the gray Apple icon and a progress bar appear. The boot up is significantly slower than normal. This will reset some caches, forces a directory check, and disables all startup and login items, among other things. If the system operates normally, there may be 3rd party applications which are causing a problem. Try deleting/disabling the third party applications after a restart. For each disable/delete, you will need to restart if you don't do them all at once.
    Safe Mode
    Safe Mode - About
    General information.
    Isolating issues in Mac OS X
    Troubleshooting Permission Issues
    Step by Step to Fix Your Mac
    If you still can't get the App Store to work, I'd contact them via the App Store Support link.

  • How to find last accessed/updated tables and the query text?

    I am using :
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.4.0 - Production
    How to find last accessed/updated tables and the query text?
    Regards
    LEE1212

    Check DBA_TBALES view there you find one date column that indicate last update
    One option is as follows:
    (1) Turn the auditing on: AUDIT_TRAIL = true in init.ora
    (2) Restart the instance if its running.
    (3) Audit the table:
         AUDIT INSERT,SELECT,DELETE,UPDATE on TableName
         by ACCESS WHENEVER SUCCESSFUL
    (4) Get the desired information using :
         SELECT OBJ_NAME,ACTION_NAME ,to_char(timestamp,'dd/mm/yyyy , HH:MM:SS')
         from sys.dba_audit_object.
    Cheer,
    Virag Sharma
    http://virag.sharma.googlepages.com/
    http://viragsharma.blogspot.com/
    Message was edited by:
    virag_sh

  • Can I update datas of Power Query after making relation tables in Power Pivot ?

    Can I update datas of Power Query after making relation tables in Power Pivot ?
    I want to update datas at day by day to viewing today's graph by Power View on Excel.
    Power Query use to transform web site to Power Pivot data model table.
    Power Pivot use to making relasing tables, and making measuers.
    Regards,
    Yoshihiro Kawabata.

    Hi Yoshihiro,
    Can you share an example of the things you are doing in Power Pivot? There are some operations that prevent the query from being refreshed in Power Query; this is not ideal so we are currently working on fixing it.
    Thanks for your feedback.

  • IOS Update stalled during install...should I reboot?

    Doing a required update to the software on my mac mini (so I could then update the ios on my iphone4s)  seems that the update stalled during the 'installing files' step.  Should I power off and try again?  Help...

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

  • Possible to update gui with new thread AND halt program execution?

    Hello, my problem is the following:
    I have a JButton that performs a sql query and retrieves information from a database, while this is done I would like to update a JLabel with information that the query is in progress. I have got this working but the problem is that I would like the main thread to wait until the search thread has finished execution, of course this inflictes with the gui update... look below for code:
    //class that synchronizes the threads when retrieving data
    public class SynkroniseradVektorKlass
       private Vector verde = new Vector();
       private boolean inteFerdig=true;
       public SynkroniseradVektorKlass(boolean inteFerdig)
          this.inteFerdig=inteFerdig;
       //sets the value of the vector
       public synchronized void settVerde(Vector verde)
           this.verde=verde;
           //set the boolean to false so the wait() can be avoided
           inteFerdig=false;
           //notify all threads that we have retrieved a value
           notifyAll();
        public synchronized Vector returneraVerde()
            //if no value has been retrieved, wait
            if(inteFerdig)
               try
                    wait();
               catch(InterruptedException ie){}
        //when waiting is done, return value
        return verde;
    //class that retrieves data and prints it
    //not really necessary here but useful to check that the SynkronisedVektorKlass
    // works
    public class TradHarDataKommit extends Thread
       private SynkroniseradVektorKlass hemtaData;
       public TradHarDataKommit(SynkroniseradVektorKlass hemtaData)
          this.hemtaData=hemtaData;
       public void run()
           System.out.println("Thread two begins");
           System.out.println("data == "+hemtaData.returneraVerde());
           System.out.println("Thread two done");
    //class that communicates with the database and retrieves the data
    public class NyTradKorSQLSats extends Thread
       private String sqlSats;
       private java.util.Timer timer;
       private JLabel label;
       private JFrame ram;
       private SynkroniseradVektorKlass tilldelaData;
       public NyTradKorSQLSats(String sqlSats,java.util.Timer timer,JLabel ,SynkroniseradVektorKlass tilldelaData,JFrame ram)
          this.sqlSats=sqlSats;
          this.timer=timer;
          this.label=label;
          this.tilldelaData=tilldelaData;
          this.ram=ram;
       public void run()
           System.out.println("Thread one begins...");
           //executes the sql query and retrieve data
           tilldelaData.settVerde(klient.korKlient(sqlSats));
           //end the timer that updates the JLabel
           timer.cancel();
           label.setText("");
           ram.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
           System.out.println("Thread one done...");
    //in actionPerformed
    java.util.Timer timer = new java.util.Timer();
    //boolean used to show when execution is done          
    boolean sokningInteFerdig=true;
    //class that holds a value retrieved from database and make sure that
    //everything is synchronized
    SynkroniseradVektorKlass dataFranSokning = new SynkroniseradVektorKlass(sokningInteFerdig);
    //class that retrieves information from dataFranSokning     
    TradHarDataKommit skrivUtData = new TradHarDataKommit(dataFranSokning);
    //class that executes sql query, with arguments sql, a timer that updates
    //the JLabel,the JLabel,the dataholding class, and a JFrame     
    NyTradKorSQLSats korTrad = new NyTradKorSQLSats("1Select namn from kundregister where kundnr=1",timer,statusRad,dataFranSokning,this);
    //a TimerTask class that updates the JLabel               
    TimerStatusRad task1 = new TimerStatusRad(statusRad,"Searching...",this);
    TimerStatusRad task2 = new TimerStatusRad(statusRad," ",this);
    //starts timer task1 directly and restarts every second
    timer.schedule(task1,0,1000);
    //starts timer task 2 after a second and restarts every second after     
    timer.schedule(task2,1000,1000);
    //set the sqlthread to daemon
    korTrad.setDaemon(true);
    //starts the thread                         
    korTrad.start();
    //I would like that the program halts here until korTrad is done
    //because the data retrieved are to be used further in the program
    //There is no point in using join(); because this would halt the update of the guiif anyone got any ideas how to solve this please help me
    ps. sorry about my english, its not my native language

    Was not able to review all of your code. But take a look at wait() and update() methods - they should solve what you need.
    Denis Krukovsky
    http://dotuseful.sourceforge.net/

  • Continuously Updating GUI

    Hi,
    I'm just wondering whats the best way to write a VI that includes two parts: one being an event driven GUI and the second being a continuously updating data display (i.e. temperature displays and graphs)? Would the only way to accomplish this to have both the controls and data collection incorporated in one loop and forget about an event structure? Both controls and data collection is for the same device and each command/query requires sufficient time for the device to process. 

    No, have the GUI display the data as well as have an event driven "control" part but put the data acquisition in another loop (or better yet another vi). They can communicate through any number of means; functional globals, queues, etc. Search on Producer-Consumer structures, both here (forum) and in the LabVIEW examples in your LabVIEW installation.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

Maybe you are looking for