Forums Register Login

Check table contents ?!!

+Pie Number of slices to send: Send
hi every one,


i have a table in the database i want to check it every 5 min. to see if there is new data in it , how this can be done ??

plz help as soon as posible.


thanks in advance
+Pie Number of slices to send: Send
hit the database at every 5 minutes !

you can use EJB Timer(in EJB 2.1), or in your program create a Thread which calls your method which hit database, or use some open source schedular.

It actually depend on your requirement that what you want to achieve

At database side you can use count of rows( but on deletion of rows you will suffer), you can use trigger on insert(I will prefer) so that you can track new records

Shailesh
[ June 26, 2005: Message edited by: Shailesh Chandra ]
+Pie Number of slices to send: Send
If you have an auto incrementing key in the table, you could also do something like:



and store that in a variable in your application. Then, when your timed event kicks off, you have some choices of what to do. You could either run the same query again and then test the returned MAX to what you have locally, or you could run a different query, such as:



or



You can do a few different things depending on the specific needs of your application.

Peace,
Phillip
grapes are vegan food pellets. Eat this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1083 times.
Similar Threads
Passed SCJD (Was: Where to i find my score?)
MySQL + Eclipselink - SEQUENCE table
how to delete huge amount of records
Multiple tables, with Multiple check boxes in each table, on the same page
Problem in output
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:13:13.