Green Fireman
Green Fireman

Reputation: 697

DbSetup simple example, SQLException occurs

There's very little information about DbSetup so I couldn't find an answer to this question anywhere else. I need to test Data Access Layer and decided to use DbSetup for it. I tried to use DbSetup user guide this example just to see how it works but I get such exception:

com.ninja_squad.dbsetup.DbSetupRuntimeException: java.sql.SQLException: No suitable driver found for 127.0.0.1:3306

My database is MySQL Server. What could be the problem?

Upvotes: 0

Views: 698

Answers (1)

JB Nizet
JB Nizet

Reputation: 691655

Your URL is incorrect. JDBC URL for MySQL looks like

jdbc:mysql://localhost:3306/databasename

as described in the documentation.

And of course, the jar of the MySQL JDBC driver must be in the classpath.

Upvotes: 1

Related Questions