Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

No suitable driver found for jdbc connection.  RSS feed

 
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm getting error - No suitable driver found for No suitable driver found for jdbc:mysql:thin:@localhost/jdbcdemo



I'm using eclipse. I have "mysql-connector-java-5.1.21.jar" added as referenced libraries.

Database name - jdbcdemo
Table name - students.
 
Ranch Hand
Posts: 974
9
IBM DB2 Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please verify if the connection url you used in the connection string is valid for MySQL. JDBC (4.0 ? not sure if the same applies to previous versions as well) checks if there is a driver accepting a given connection url.
 
Shubham Semwal
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Connection con = DriverManager.getConnection("jdbc:mysql:thin://localhost/jdbcdemo","root","");

No idea what is being done here. I've installed wamp server and created db there. My database name is jdbcdemo.
MySQL version - 5.6.12

profile being used in MySQL : Username - root password -"".
 
Saloon Keeper
Posts: 4691
117
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
+1 on what Claude said - the "thin:" part looks fishy. Where did you get that from?
 
Shubham Semwal
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I removed "thin". Now its working but I'm super confused.
I gues I mixed syntaxes for OracleDB and Mysql :
Oracle : jdbc: oracle:thin:@localhost:1521:xe
MySQL : jdbc:mysql://localhost/jdbcdemo

I thought "thin" is used for a driver. Why aren't we using that in MySQL syntax ?
 
Tim Moores
Saloon Keeper
Posts: 4691
117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "thin" part is an Oracle thing; it does not apply to MySQL. Actually, the entire part after the 2nd colon is specific to the driver, so there's a lot of variety.
 
Shubham Semwal
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot @tim and @claude
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!