Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8836379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:28:50+00:00 2026-06-14T09:28:50+00:00

BackGround : I am using Quartz scheduler with Spring to schedule a cronjob. Question:

  • 0

BackGround :

I am using Quartz scheduler with Spring to schedule a cronjob.

Question:

I am configuring the scheduler options in my applicationconfig file. Rather, I want to specify these options programatically in my java class. Any ideas on how to achieve this?
My Code is as below,

ApplicationConfig

<!-- Cron Trigger -->
<bean id="SimpleTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
  <property name="jobDetail" ref="TaskJobDetail" />
  <property name="cronExpression" value="0 19 14 * * ?" />  
</bean>

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
 <property name="jobDetails">
    <list>
    <ref bean="TaskJobDetail" />
    </list>
</property>  
<property name="triggers">
    <list>
    <ref bean="SimpleTrigger" />
    </list>
</property>
</bean>

I want to set the cronExpression programatically in my java class. Any ideas please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:28:52+00:00Added an answer on June 14, 2026 at 9:28 am

    Of course, you first have to inject the Quartz scheduler to your Java class (Spring bean):

    @Autowired
    private Scheduler scheduler;
    

    Then simply use Quartz API:

    import static org.quartz.TriggerBuilder.*;
    import static org.quartz.CronScheduleBuilder.*;
    import static org.quartz.DateBuilder.*:
    
    JobDetail job = newJob(SimpleJob.class).build();
    
    CronTrigger trigger = newTrigger()
        .withSchedule(cronSchedule("0 19 14 * * ?"))
        .build();
    
    schedulder.scheduleJob(job, trigger);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a UnitOfWork in a background task method (operated by Quartz) with Guice-persist
I want to be able to create a transparent background using only CSS but
Whenever I am using a quartz animation the background of the animation is white.
i have 3 navigation controller and i want to change each background using different
i want to change navigation bar background using my own image, but i really
I want to run a PHP script in the background using another PHP script.
How can I set a background using C++ object declared in QML file that
Background: Using unix, codeigniter from localhost. I'd like to run a controllers via a
Background Using boost and other similar libraries is the easiest way to find compiler
Background: Using jQuery 1.7 client side PHP server side Using json responses with json_encode

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.