Issue with Connecting My SQL

Hi Guys,

I need to connect My SQL server with WF, am using the below code in my web harvest XML but no luck, facing below issue.

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

Will my WF allows download from Maven?

    import groovy.sql.Sql
	this.class.classLoader.addURL(new URL(""))
	def url = 'jdbc:mysql://localhost:3306/sakila'
	def user = 'root'
	def password = 'admin'
	def driver = 'com.mysql.jdbc.Driver'
	def sql = Sql.newInstance(url, user, password, driver)

	sql.execute '''
	  select first_name from actor


Any help or suggestions much appreciated?

jdbc uses different classloader than groovy/beanshell. In order for it to properly work - the jar need to be added to the classpath before WorkFusion App or WorkFusion Studio start up.
WorkFusion App server comes with mysql driver pre-packaged (tomcat/lib/mysql-connector-java-5.1.15.jar), so on the WorkFusion server the code should work fine without adding extra jar.
In WorkFusion Studio - add the jar to the Eclipse classpath.

Also check out the out-of-the-box database plugin (
Code would look something like following:

    <database connection="jdbc:mysql://localhost:3306/sakila" jdbcclass="com.mysql.jdbc.Driver"
    		username="user" password="securepassword">

    		select first_name from actor

@azhemoytuk Thank you very much, worked for me. Cheers!!

1 Like


can u please share the screen shot how u have connect the MySQL connectivity with workfusion from scratch, I am new to it and very confused with this part. Please help .

Jasnoor kaur