Deleting some data as a periodic/scheduling job In Java

I am working in Java project with Spring and Hibernate framework. The database used is Oracle and application server is JBoss 4 and OS is Unix.

I have to write a logic that will delete the data from all the tables older than 180 days.There is a date column in a particular table using which I have to determine if it is older than 180 days or not. if it is I will have to delete all rows from that table and any associated row from any other table as well.I can use hibernate to delete such data from the tables.

This functionality will be scheduled i.e. the delete logic will be called at some periodic time may be daily at 3:00 p.m., exact time client will inform me soon.This logic has to be separated from the application war that I usually make of my actual project source code.

I don't have any issue in writing the persistence related code that will delete the data but I am confused about how to put this logic separately in JBoss. Shall I make jar of the code and put that in JBoss? And also how will the delete logic be called? Do I need to configure/write some scheduler that will do this job?

Can somebody please help me with this?


Have a look at Quartz. It's a relatively easy to use scheduler for Java. You should be able to get this up and running very quickly.

Need Your Help

Using session variable for load more

php mysql session

My issue is am using jQuery to auto refresh the div but am using the following script to keep the record track, so if the user clicks on Load More I load the posts, but the moment jQuery refreshes ...

JMS web application with Eclipse and WebSphere Application Server

eclipse jms websphere-7

I am new to JMS and WAS. I am grateful if someone provides any reference that helps me to create a web application in eclipse with JMS and WAS 7.0.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.