[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: sherry  XML
Profile for sherry -> Messages posted by sherry [5]
Author Message
I tried giving existing data source connection but it doesn't work


It gives exception

foo.too..PSQLDataSource cannot be cast to org.quartz.utils.ConnectionProvider



Code:
 Quartz.properties 
 
 org.quartz.dataSource.myCustomDS.connectionProvider.class = foo.too..PSQLDataSource 
 org.quartz.dataSource.myCustomDS.someStringProperty = someValue
 org.quartz.dataSource.myCustomDS.someIntProperty = 5
 
 org.quartz.jobStore.class =org.quartz.impl.jdbcjobstore.JobStoreTX 
 



I have tried giving complete data source string too but it also not worked
and got error as java.lang.NoClassDefFoundError: org/apache/commons/dbcp/BasicDataSource

Code:
 org.quartz.dataSource.myDS.driver = org.postgresql.Driver
 org.quartz.dataSource.myDS.URL = jdbc:postgresql:thin:@localhost:5432:mcs
 org.quartz.dataSource.myDS.user = mcsadmin
 org.quartz.dataSource.myDS.password = mcsadminpw
 org.quartz.dataSource.myDS.maxConnections = 30
 


When I am creating inner class to execute job it doesn't fire job.
Code:
 
 class Mainclass {
 protected SchedulerFactory schedulerFactory = null;
 protected Scheduler scheduler = null;
 
 public void addJob(String arg[]){
 
 schedulerFactory=new StdSchedulerFactory();
 scheduler = schedulerFactory.getScheduler();
 scheduler.start();
 
 Job job = new Job();
 job.addJob("Job1");
 }
 
 } class Mainclass end 
 
 
 class Job {
 
 public void addJob(String jobName){
 
                 JobDetail job = new JobDetail(jobName,MyJobs.class);
 /*
 I have tried with Job.MyJobs.class too but it doesn't work  
 
 */
 		 Date runTime = TriggerUtils.getEvenSecondDate(new Date());
 		SimpleTrigger trigger = new SimpleTrigger("trigger1", "group1", runTime);
 		log.debug(">> addJob JobManager 3");
 
 
 }
 
 class MyJobs implements Job{
 	public void execute(org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionException{
 		System.out.println("VS JOB<<<<<<<<<<<<<");
 
 	     
 	}
 
 } //class  Myjobs end 
 
 } //Class  JobEnd 
 
Is their any way where one class can have multiple execute.

I want to execute multiple jobs from one class.


any example where I can see how do I write my own JobFactory class
Hi,
I am new to Quartz and I have some questions .
as far as I know scheduler.start actually create instance of jobclass and then invoke execute method of it , is their any way where i can pass instance of job class instead of Class reference.


I want to avoid too many instance creation of my class because I want to add several method of that class in job .


What I meant is

Class Node implements Job {

public void execute(.....) {
}
}

Class Test {

public static void main(String arg[]){
JobDetail jd = new JobDetail(Node.class);

Sched.start() ----------------------------> will create one instance per jobDetail



}

}

Now when I will pass
 
Profile for sherry -> Messages posted by sherry [5]
Go to:   
Powered by JForum 2.1.7 © JForum Team