Java DB rotation
- From: Jim Lee <jimlee2907@xxxxxxxxx>
- Date: Mon, 30 Jan 2012 18:08:04 -0800
I have a Java server controller that read/write to Database table
Java server will start read / write to a new DB table every
week/monday
e.g.
table-1-2-2012
table-1-9-2012
table-1-16-2012
table-1-23-2012 ... etc
I think of 2 ways to do the DB table rotation
1) check the server timestamp, if today's date is week of 1-23-2012,
then read/write to table-1-23-
2012
2) have a unix corn job run every monday to generate a text file on
Java server with DB table named on
that date - on each Java request, check the text file's table name -
then read/write to that DB table
any other solution to DB table rotation?
the first way check timestamp have a drawback when server's time is
not set to correct time, since
there are many Java server running for load balance, it's not a good
idea.
the second way is a better solution, but request additional setup -
cron job
.
- Follow-Ups:
- Re: Java DB rotation
- From: Arne Vajhøj
- Re: Java DB rotation
- From: Martin Gregorie
- Re: Java DB rotation
- From: Arne Vajhøj
- Re: Java DB rotation
- Prev by Date: Re: how to read back the lines printed out to the console?
- Next by Date: Re: Java DB rotation
- Previous by thread: ACM ISMM 2012 Call for Papers
- Next by thread: Re: Java DB rotation
- Index(es):
Relevant Pages
|