No suitable driver found for jdbc:mysql

Hi,

I am a new jruby user. I am using jruby-complete-1.7.11
I have got a script which is connecting to MySQL db and fetching some
data.

While executing I am getting error “No suitable driver found for
jdbc:mysql”

Need help to solve this error.

Doesn’t look like a JRuby problem to me. My guess is that the connect
also doesn’t work from pure Java - did you try this? In this case, I
would conclude that the MySql database driver is missing.

The reason you got this error is because you forgot to register your java mysql jdbc driver with the application.

Should be like this:

Class.forName("com.mysql.jdbc.Driver");

This forces the driver to register itself, so that Java knows how to handle those database connection strings.

You’ll have to read the manual on your specific mysql jdbc driver to find the exact string to place inside the the Class.forName("…") parameter.

Thanks for this case. I also have the same solution!

Unlike the traditional app development cycle, a project planning process helps you work faster and reduces costs considerably. When you opt for app builders, you get a professional team that understands the entire app development process and works towards a single goal -deliver your app or website according to your custom requirements. The team management system helps you work with a team of highly skilled professionals who work with you and your business requirements round the clock. You can discuss all the features you want in your app and get the help you require in the planning, execution and maintenance of your app. The team management system allows you to track the entire project progress and makes sure no feature is left out. The entire project planning process ensures that you end up with a perfect app that will help you in multiple ways including business growth.