Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't connect to MySql database - No suitable driver found

 
Michael D Sims
Ranch Hand
Posts: 111
1
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm using the sql20 class to do some simple database stuff. It seems nice and simple so I decided to give it a go. Here is a simple class I created with sql2o and when I call the method to update the table, I get this error from the compiler:

Could not acquire a connection from DataSource - No suitable driver found for jdbc:mysql://localhost:3306/Downloads

I can connect to the database just fine with MySql Workbench as well as execute SELECT and UPDATE queries. The problem is strictly with sql2o

Any ideas?

Thank you!


 
Dave Tolls
Ranch Hand
Posts: 2369
25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you got a MySQL JDBC driver jar file on your runtime path?
That looks like the Connector/J  connection string.
 
Michael D Sims
Ranch Hand
Posts: 111
1
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:Have you got a MySQL JDBC driver jar file on your runtime path?
That looks like the Connector/J  connection string.

I just figured that out ... didn't have it in my classpath and apparently had a brainfart ... ID10T error

Thank you
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!