JonRock
15 years agoNew Contributor
SOLVED: No Suitable Driver found for jdbc
import groovy.sql.Sql
def db = Sql.newInstance("jdbc:mysql:sqlserver://localhost:3306/deepspace6_persistent", "root", "admin", "com.mysql.jdbc.Driver");
Im using SoapUI 3.6 and I have the "mysql-connector-java-5.1.13-bin.jar" in the /ext and /lib folder and I can see it being loaded in the soap.log
I get the following error: java.sql.sqlexception: No Suitable Driver found for jdbc:mysql:sqlserver://localhost:3306/deepspace6_persistent
I looked through several topics adressing the same problem and read about using something like this
groovyUtils.registerJdbcDriver("com.mysql.jdbc.Driver");
but the function registerJdbcDriver() doesnt seem to exist in my soapui version
EDIT: I updated to 3.6.1 and registerJdbcDriver is found but does not solve the problem.
SOLVED: Okay apparently I got the syntax wrong and for my driver its supposed to be:
jdbc:mysql://[host][,failoverhost...][:port]/[database]
I advise anyone with the same problem to check the driver documentations for the exact syntax. The error message is really misleading.