title: Failed to obtain DB connection from data source
body: <p>I'm creating a in memory quartz scheduler in Spring Boot, but getting a connection error.
  I have a connected database 'oracle'. once i run I get following error. Can anybody help</p>
  <pre><code>ERROR [http-nio-80-exec-1] org.apache.juli.logging.DirectJDKLog: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'myDS': java.sql.SQLException: Connections could not be acquired from the underlying database!
  </code></pre>
  <p>this is my quartz.properties file</p>
  <pre><code>#============================================================================
  # Configure Main Scheduler Properties
  #============================================================================
  org.quartz.scheduler.instanceId = AUTO
  org.quartz.scheduler.makeSchedulerThreadDaemon = true
  
  #============================================================================
  # Configure ThreadPool
  #============================================================================
  
  org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
  org.quartz.threadPool.makeThreadsDaemons = true
  #org.quartz.threadPool.threadCount= 20
  #org.quartz.threadPool.threadPriority= 5
  
  #============================================================================
  # Configure JobStore
  #============================================================================
  org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
  org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
  org.quartz.jobStore.useProperties=true
  org.quartz.jobStore.misfireThreshold=25000
  org.quartz.jobStore.tablePrefix=QRTZ_
  org.quartz.jobStore.isClustered=false
  org.quartz.jobStore.dataSource=myDS
  
  #============================================================================
  # Configure Datasources
  #============================================================================
  
  org.quartz.dataSource.myDS.driver = oracle.jdbc.pool.OracleDataSource
  org.quartz.dataSource.myDS.URL = jdbc:oracle:thin:@x.x.x.x:1521:fdf
  org.quartz.dataSource.myDS.user = username
  org.quartz.dataSource.myDS.password = password
  org.quartz.dataSource.myDS.maxConnections = 5
  org.quartz.dataSource.myDS.validationQuery = select 1
  </code></pre>
  <p>this is how I created scheduler in Controller class</p>
  <pre><code>@RequestMapping(&quot;/start&quot;)
    public String start() throws SchedulerException {
    Scheduler scheduler;
    SchedulerFactory schedulerFactory  = new StdSchedulerFactory(quartzProperties());
  scheduler = schedulerFactory.getScheduler();
      JobDetail jobDetail =
                  JobBuilder.newJob(Job1.class)
                      .usingJobData(&quot;job1&quot;, &quot;description&quot;)
                      .storeDurably(true)
                      .requestRecovery(true)
                      .build();
              scheduler.scheduleJob(jobDetail, Trigger1.fire());
  scheduler.start();
  return &quot;redirect:/&quot;;
  }
    @Bean
    public Properties quartzProperties() throws IOException {
      PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
      propertiesFactoryBean.setLocation(new ClassPathResource(&quot;/quartz.properties&quot;));
      propertiesFactoryBean.afterPropertiesSet();
      return propertiesFactoryBean.getObject();
    }
  </code></pre>
  <p>and Job1.class</p>
  <pre><code>@Slf4j
  public class Job1 implements Job {
  
    @Override
    public void execute(JobExecutionContext jobContext) {
      JobDetail jobDetail = jobContext.getJobDetail();
      log.info(
          &quot;\nname: {}, \nstart: {}, \nnext: {}&quot;,
          jobDetail.getJobDataMap().getString(&quot;job 1&quot;),
          jobContext.getFireTime(),
          jobContext.getNextFireTime());
    }
  }
  </code></pre>
  <p>and this is Trigger1 class</p>
  <pre><code>public class Trigger1 {
  
    public static Trigger trigger;
  
    public static Trigger fire() {
      trigger =
          TriggerBuilder.newTrigger()
              .withIdentity(&quot;trigger 1&quot;)
              .startAt(new Date())
              .withSchedule(CronScheduleBuilder.cronSchedule(&quot;/1 * * ? * * *&quot;))
              .build();
      return trigger;
    }
  }
  </code></pre>
  <p>Furthermore I run this sql scripts in my db <a href="https://github.com/quartznet/quartznet/blob/master/database/tables/tables_oracle.sql" rel="nofollow noreferrer">tables_oracle.sql</a></p>