aspose file tools*
The moose likes JDBC and the fly likes Some sort of trigger. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Some sort of trigger." Watch "Some sort of trigger." New topic
Author

Some sort of trigger.

Tristan Van Poucke
Ranch Hand

Joined: Jun 30, 2008
Posts: 47
I'm sorry if this is in the wrong category but I didn't really know where to put this, and this category seemed the best choice.

I want to put 1 of my members of my site "in the spotlight", what I mean by this is to put a part of their "member-information" on my homepage for 1 week or maybe for 1 day, I don't know how long yet, what I do know is that I want this to happen automatically.

So I would need to randomly pick 1 user and store it in the database that this user is in the spotlight today. But how do I know when to pick the next user? The server would have to trigger a method. Or there should be somekind of trigger in MySQL.

Does anyone know how to do this?
I'm working with tomcat 6.0
and PHPMyAdmin for MySQL

thanks in advance.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
Are you sure you want a trigger rather than an event?
Try the MySQL manual (index = t) for a start.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1134

Tristan,
Unless I've misunderstood your question, I suggest using a job scheduler, either in the database or java or the operating system.
If you are on UNIX/linux, then there is cron.
(Apparently there is also cron for Windows.)
There are java schedulers, like Quartz.
There is also the Timer class.
Some databases have job schedulers.
Oracle has the DBMS_JOB package.

Good Luck,
Avi.
 
Consider Paul's rocket mass heater.
 
subject: Some sort of trigger.