no suitable driver found for jdbc when using Job Scheduler Quartz

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

no suitable driver found for jdbc when using Job Scheduler Quartz

rom-a305d
This post was updated on .
hello, i am having a problem here, when i put this code to my /job/jobScheduler.groovy i used Quartz plugin to schedule some execution. What i simply want to achieve is to retrieve some data from the database table at some interval time, but when i try to access to mysql database, it always throws some error of
"no suitable driver found for jdbc".. but i perfectly stated it at my program..
The thing is when i put this code to my Controller, it perfectly works fine.. All i want is to get rid of this "driver" thing error.

package test
import groovy.sql.Sql

class TestJob {
    static triggers = {
      simple name: 'mySimpleTrigger', startDelay: 1000, repeatInterval: 1000  
    }
 
  def execute(){
 
  def dataSource // the Spring-Bean "dataSource" is auto-injected
 
  def db = new Sql(dataSource) // Create a new instance of groovy.sql.Sql with the DB of the Grails app

   def result = db.rows("SELECT Label, data, testDate from testData order by testDate") // Perform the query

 
      ......

        ...
  }
}

Any help?