Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What are you trying to accomplish?<br> Is it some sort of real time monitoring application like stock trading, plant monitoring software or do you have grid in some CRUD application that you want automatically update?</p> <p>If this is a <strong>crud application</strong>, then first thing I would do is to check requirements: </p> <ul> <li>Is it really necessary for your user to have updated information automatically all the time, </li> <li>Does your user looks at monitor all the time? </li> <li>Why? Maybe you can implement some sort of alert system that can be checked less often?</li> </ul> <p>If you really really need approach you described, then you did fine - you can use either timer or some other event(button, mouse move, ...) to refresh data. Of course, constant requerying will become performance problem as number of users raise. </p> <p>If it is <strong>real time monitoring software</strong> with lots of data than you should not put database in center of system. You should have central service that your clients connect to over TCP (or some similar protocol). Central service should keep latest state of system (plus maybe some history). Clients can attach to service and service should notify clients when there is new data, so that you avoid constant polling. Database should be used as log that application uses for analysis of past events, but not for real time display. </p> <p><strong>Edit :</strong></p> <p>Regarding Andrej's answer: I am not sure if this resolves your problem. Observer pattern is usually implemented with subscribe/notify mechanism, so that data source can notify all observers when data changes. Problem is that RDBMS's usually do not have mechanism that can notify you about data change. Even if they have, it is not practical because there can be large number of changes in short period of time. Think of tens or hundreds of updates in second - how often RDBMS should notify clients about change? What if there are hundreds of clients with slow network? When you have more than one user, things become complicated. </p> <p>Databinding works in process - you cannot bind your grid directly to table in database. You first need to get data to your application into some object that can be bound to GUI (datasets, lists, ...)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload