Hi Anurag,
You can implement both Database.Batchable and Schedulable in the same class like this:
global class ScheduleAndBatch implements Database.Batchable<sObject>, Schedulable {
global Database.QueryLocator start(Database.BatchableContext BC) {
}
global void execute(Database.BatchableContext BC, List<sObject> lstSobects) {
}
global void finish(Database.BatchableContext BC) {
}
global void execute(SchedulableContext sc) {
Type t = Type.forName(‘ScheduleAndBatch’);
Database.Batchable< sObject > batchClass = ((Database.Batchable< sObject >) t.newInstance());
Database.executeBatch(batchClass, this.scope);
}
}
Thanks.