JSP is based on http. Http is a request/response mechanism.
Whether it is possible at all depends on whether the database presents a mechanism by which it can send automatic information about updates to listening clients.
Personally I'd never do such a thing. A polling mechanism works a lot better and is less of a drain on system resources.
As already mentioned, HTTP is a request/response protocol; what this implies is that the server can push updates/send a response only when requested. So you can two choices to update your data on screen:
- Use long lived connections to implement server push. The way this normally works is that the initial request which loads the data doesn't close the connection.
- Use polling as already mentioned.
Both approaches end up consuming resources. Server push keeps all the connections occupied which might lead to the server running out of connections if a lot of clients are using your application. Polling leads to the server being bombarded with constant requests even when there is no data which can be pushed to the client.
You might want to review your requirements and decide which approach suits you best. Here is an interesting read about the different async technologies BTW.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: